rest of work to convert unwind-protects to ANSI/ISO C; size_t updates; function prototype changes for ANSI/ISO C

This commit is contained in:
Chet Ramey
2023-04-03 12:07:25 -04:00
parent d267701a91
commit 877ff72675
34 changed files with 560 additions and 147 deletions
+1 -1
View File
@@ -896,7 +896,7 @@ history_expand_internal (const char *string, int start, int qc, int *end_index_p
#define ADD_CHAR(c) \
do \
{ \
if (j >= result_len - 1) \
if ((j + 1) >= result_len) \
result = (char *)xrealloc (result, result_len += 64); \
result[j++] = c; \
result[j] = '\0'; \
+1 -1
View File
@@ -482,7 +482,7 @@ _rl_char_value (const char *buf, int ind)
if (_rl_utf8locale && UTF8_SINGLEBYTE(buf[ind]))
return ((WCHAR_T) buf[ind]);
l = strlen (buf);
if (ind >= l - 1)
if (ind + 1 >= l)
return ((WCHAR_T) buf[ind]);
if (l < ind) /* Sanity check */
l = strlen (buf+ind);
-7
View File
@@ -31,17 +31,10 @@ extern "C" {
#if !defined (_FUNCTION_DEF)
# define _FUNCTION_DEF
#if defined(__GNUC__) || defined(__clang__)
typedef int Function () __attribute__((deprecated));
typedef void VFunction () __attribute__((deprecated));
typedef char *CPFunction () __attribute__((deprecated));
typedef char **CPPFunction () __attribute__((deprecated));
#else
typedef int Function ();
typedef void VFunction ();
typedef char *CPFunction ();
typedef char **CPPFunction ();
#endif
#endif /* _FUNCTION_DEF */