From 6e9bba3889b1404c22f1cef31354597862766f26 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 9 May 2004 19:29:42 +0000 Subject: (unquote): Use xcalloc rather than xmalloc and a loop initializing the just-allocated memory to zero. --- src/tr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/tr.c b/src/tr.c index b38d99835..3bb9cec6f 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++) -- cgit v1.2.3-54-g00ecf