eliminate (harmless in this case) vla usage in fnmatch.c
authorRich Felker <dalias@aerifal.cx>
Sun, 5 Jun 2011 17:30:56 +0000 (13:30 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 5 Jun 2011 17:30:56 +0000 (13:30 -0400)
src/regex/fnmatch.c

index 5f2fccd..c0856f9 100644 (file)
@@ -102,7 +102,7 @@ int fnmatch(const char *p, const char *s, int flags)
                                        if (!*z || z-p > 32) { /* FIXME: symbolic const? */
                                                return FNM_NOMATCH;
                                        } else {
                                        if (!*z || z-p > 32) { /* FIXME: symbolic const? */
                                                return FNM_NOMATCH;
                                        } else {
-                                               char class[z-p+1];
+                                               char class[33];
                                                memcpy(class, p, z-p);
                                                class[z-p] = 0;
                                                if (iswctype(k, wctype(class)))
                                                memcpy(class, p, z-p);
                                                class[z-p] = 0;
                                                if (iswctype(k, wctype(class)))