From: Jim Meyering Date: Sun, 9 May 2004 19:29:42 +0000 (+0000) Subject: (unquote): Use xcalloc rather than xmalloc and X-Git-Tag: v5.3.0~1602 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e9bba3889b1404c22f1cef31354597862766f26;p=thirdparty%2Fcoreutils.git (unquote): Use xcalloc rather than xmalloc and a loop initializing the just-allocated memory to zero. --- diff --git a/src/tr.c b/src/tr.c index b38d998355..3bb9cec6fd 100644 --- a/src/tr.c +++ b/src/tr.c @@ -478,9 +478,7 @@ unquote (const unsigned char *s, struct E_string *es) len = strlen ((char *) s); es->s = xmalloc (len); - es->escaped = xmalloc (len * sizeof (es->escaped[0])); - for (i = 0; i < len; i++) - es->escaped[i] = 0; + es->escaped = xcalloc (len, sizeof es->escaped[0]); j = 0; for (i = 0; s[i]; i++)