diff options
author | Jim Meyering <jim@meyering.net> | 2004-05-09 19:29:42 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-05-09 19:29:42 +0000 |
commit | 6e9bba3889b1404c22f1cef31354597862766f26 (patch) | |
tree | ba34779e65d59a344c67930a88734a66f09b8f43 /src | |
parent | acf15d516301ee85cb03a655b36009e1a7d06473 (diff) | |
download | coreutils-6e9bba3889b1404c22f1cef31354597862766f26.tar.xz |
(unquote): Use xcalloc rather than xmalloc and
a loop initializing the just-allocated memory to zero.
Diffstat (limited to 'src')
-rw-r--r-- | src/tr.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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++) |