aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.vnet.ibm.com>2015-08-26 10:26:26 +0200
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2015-08-26 10:26:26 +0200
commit808d70228891ab4d4795ab3dd1e015bf63ba18d6 (patch)
tree3d3222d3e9e23e93d5925d05d55749071384ebdc /sysdeps
parent1efad39b227c0d3cd0641cae70c7e95c8ca290a6 (diff)
downloadglibc-808d70228891ab4d4795ab3dd1e015bf63ba18d6.zip
glibc-808d70228891ab4d4795ab3dd1e015bf63ba18d6.tar.gz
glibc-808d70228891ab4d4795ab3dd1e015bf63ba18d6.tar.bz2
S390: Fix build error with gcc6 in utf8_utf16-z9.c.
This patch fixes the build error with gcc6: array subscript is above array bounds [-Werror=array-bounds] While including loop.c to construct the SINGLE(LOOPFCT) method for converting from UTF-16 to UTF-8, the bytebuf array with length MAX_NEEDED_INPUT is used as inptr. MAX_NEEDED_INPUT defaults to MIN_NEEDED_INPUT if not defined before including loop.c. Thus bytebuf has a length of 2. This patch defines MAX_NEEDED_INPUT to MAX_NEEDED_TO, which is 4. ChangeLog: * sysdeps/s390/s390-64/utf8-utf16-z9.c (MAX_NEEDED_INPUT): New define. (MAX_NEEDED_OUTPUT): New define.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/s390/s390-64/utf8-utf16-z9.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c
index 1425cb1..6712c1c 100644
--- a/sysdeps/s390/s390-64/utf8-utf16-z9.c
+++ b/sysdeps/s390/s390-64/utf8-utf16-z9.c
@@ -183,6 +183,7 @@ gconv_end (struct __gconv_step *data)
#define MIN_NEEDED_INPUT MIN_NEEDED_FROM
#define MAX_NEEDED_INPUT MAX_NEEDED_FROM
#define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+#define MAX_NEEDED_OUTPUT MAX_NEEDED_TO
#define LOOPFCT FROM_LOOP
/* The software implementation is based on the code in gconv_simple.c. */
#define BODY \
@@ -340,6 +341,7 @@ gconv_end (struct __gconv_step *data)
/* Conversion from UTF-16 to UTF-8. */
#define MIN_NEEDED_INPUT MIN_NEEDED_TO
+#define MAX_NEEDED_INPUT MAX_NEEDED_TO
#define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
#define MAX_NEEDED_OUTPUT MAX_NEEDED_FROM
#define LOOPFCT TO_LOOP