summaryrefslogtreecommitdiff
path: root/lib/readtokens.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-04-11 12:20:35 +0000
committerJim Meyering <jim@meyering.net>2003-04-11 12:20:35 +0000
commit58b92bbeb23db76f96843e8a6784940fe0d902b2 (patch)
tree00bc3b6883550af46200926702de211820a40b1c /lib/readtokens.c
parent9def4be367ef67f9e5064ac5a0d20cf5e41f4285 (diff)
downloadcoreutils-58b92bbeb23db76f96843e8a6784940fe0d902b2.tar.xz
Remove anachronistic casts of xmalloc, xrealloc, and xcalloc return values.
Diffstat (limited to 'lib/readtokens.c')
-rw-r--r--lib/readtokens.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/readtokens.c b/lib/readtokens.c
index 74585a586..bd288f3ee 100644
--- a/lib/readtokens.c
+++ b/lib/readtokens.c
@@ -62,7 +62,7 @@ init_tokenbuffer (tokenbuffer)
token_buffer *tokenbuffer;
{
tokenbuffer->size = INITIAL_TOKEN_LENGTH;
- tokenbuffer->buffer = ((char *) xmalloc (INITIAL_TOKEN_LENGTH));
+ tokenbuffer->buffer = (xmalloc (INITIAL_TOKEN_LENGTH));
}
/* Read a token from `stream' into `tokenbuffer'.
@@ -184,8 +184,8 @@ readtokens (FILE *stream,
else
projected_n_tokens = 64;
sz = projected_n_tokens;
- tokens = (char **) xmalloc (sz * sizeof (char *));
- lengths = (long *) xmalloc (sz * sizeof (long));
+ tokens = xmalloc (sz * sizeof (char *));
+ lengths = xmalloc (sz * sizeof (long));
init_tokenbuffer (token);
for (;;)
@@ -195,8 +195,8 @@ readtokens (FILE *stream,
if (n_tokens >= sz)
{
sz *= 2;
- tokens = (char **) xrealloc (tokens, sz * sizeof (char *));
- lengths = (long *) xrealloc (lengths, sz * sizeof (long));
+ tokens = xrealloc (tokens, sz * sizeof (char *));
+ lengths = xrealloc (lengths, sz * sizeof (long));
}
if (token_length < 0)
@@ -206,7 +206,7 @@ readtokens (FILE *stream,
lengths[n_tokens] = -1;
break;
}
- tmp = (char *) xmalloc ((token_length + 1) * sizeof (char));
+ tmp = xmalloc ((token_length + 1) * sizeof (char));
lengths[n_tokens] = token_length;
tokens[n_tokens] = strncpy (tmp, token->buffer,
(unsigned) (token_length + 1));