X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemmem.c;h=57c6560323c042b8060c012c4711b3328e5dccee;hb=fec00c917a873fe54b61a911ea22e07f7c48386b;hp=b7f3e12c6cbba2989019250c9ad188a6685d8e36;hpb=f1c88d2ef7d0860d2374e325d0b26febc11479b7;p=gnulib.git diff --git a/lib/memmem.c b/lib/memmem.c index b7f3e12c6..57c656032 100644 --- a/lib/memmem.c +++ b/lib/memmem.c @@ -39,10 +39,7 @@ knuth_morris_pratt (const char *haystack, const char *last_haystack, const char **resultp) { /* Allocate the table. */ - size_t *table; - if ((size_t) -1 / sizeof (size_t) < m) - return false; - table = (size_t *) malloca (m * sizeof (size_t)); + size_t *table = (size_t *) nmalloca (m, sizeof (size_t)); if (table == NULL) return false; /* Fill the table.