mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-07 18:52:35 +02:00
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:
@@ -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'; \
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user