pp.c: Use correct size for two arrays.
authorKarl Williamson <public@khwilliamson.com>
Tue, 18 Jun 2013 19:24:14 +0000 (13:24 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 18 Jun 2013 20:10:44 +0000 (14:10 -0600)
The number of bytes the result of changing the case of a single UTF-8
character is given by UTF8_MAXBYTES_CASE.  In one of these arrays, space
is saved by using the proper #define; in the other there is no change
except on EBCDIC platforms.

pp.c

diff --git a/pp.c b/pp.c
index 670c3f1..e3d3260 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3738,7 +3738,7 @@ PP(pp_uc)
 
     if (DO_UTF8(source)) {
        const U8 *const send = s + len;
-       U8 tmpbuf[UTF8_MAXBYTES+1];
+       U8 tmpbuf[UTF8_MAXBYTES_CASE+1];
        bool tainted = FALSE;
 
        /* All occurrences of these are to be moved to follow any other marks.
@@ -4141,7 +4141,7 @@ PP(pp_fc)
     const U8 *s;
     const U8 *send;
     U8 *d;
-    U8 tmpbuf[UTF8_MAXBYTES * UTF8_MAX_FOLD_CHAR_EXPAND + 1];
+    U8 tmpbuf[UTF8_MAXBYTES_CASE + 1];
     const bool full_folding = TRUE;
     const U8 flags = ( full_folding      ? FOLD_FLAGS_FULL   : 0 )
                    | ( IN_LOCALE_RUNTIME ? FOLD_FLAGS_LOCALE : 0 );