X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fxmalloc.c;h=89ecf17ad0851dc47687ac3e323e6743a2f942b3;hb=1a2869593e115e4a6c74aaa0b23ca612357403ce;hp=b1f6993e3d603b2905bc4aed3198e8f817ad4563;hpb=34ebad3df7a99eea326f9170f2517b5d23873d1b;p=gnulib.git diff --git a/lib/xmalloc.c b/lib/xmalloc.c index b1f6993e3..89ecf17ad 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -113,24 +113,6 @@ xmemdup (void const *p, size_t s) return memcpy (xmalloc (s), p, s); } -/* Clone an object P of size S, with error checking, and include a - terminating NUL byte. - - The terminating NUL makes it safe to use strlen or rawmemchr to - check for embedded NUL; it also speeds up algorithms such as escape - sequence processing on arbitrary memory, by making it always safe - to read the byte after the escape character rather than having to - check if each escape character is the last byte in the object. */ - -void * -xmemdup0 (void const *p, size_t s) -{ - char *result = xcharalloc (s + 1); - memcpy (result, p, s); - result[s] = 0; - return result; -} - /* Clone STRING. */ char *