summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-05-09 19:29:42 +0000
committerJim Meyering <jim@meyering.net>2004-05-09 19:29:42 +0000
commit6e9bba3889b1404c22f1cef31354597862766f26 (patch)
treeba34779e65d59a344c67930a88734a66f09b8f43 /src
parentacf15d516301ee85cb03a655b36009e1a7d06473 (diff)
downloadcoreutils-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.c4
1 files changed, 1 insertions, 3 deletions
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++)