X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=kwset.c;h=fc439e0667f137f3449635a37a32f8418d5041f0;hb=984da7f8d2589b53cca7c920e597eab30d4c1b36;hp=090ffcafa2bd0eeff8bbc08ea15867fe8f5b7890;hpb=0af6d5dd062909eee3762e5fdec873ba6e7754b4;p=thirdparty%2Fgit.git diff --git a/kwset.c b/kwset.c index 090ffcafa2..fc439e0667 100644 --- a/kwset.c +++ b/kwset.c @@ -38,7 +38,13 @@ #include "compat/obstack.h" #define NCHAR (UCHAR_MAX + 1) -#define obstack_chunk_alloc xmalloc +/* adapter for `xmalloc()`, which takes `size_t`, not `long` */ +static void *obstack_chunk_alloc(long size) +{ + if (size < 0) + BUG("Cannot allocate a negative amount: %ld", size); + return xmalloc(size); +} #define obstack_chunk_free free #define U(c) ((unsigned char) (c))