summaryrefslogtreecommitdiffstats
path: root/libidu/scanners.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-01-04 16:29:18 +0100
committerJim Meyering <meyering@redhat.com>2008-01-30 21:34:33 +0100
commit79f0ffc240ee3fe6789a90ec01ae0503aced7927 (patch)
treefd6d5a9c9f487c6f869c2abddf4be05c9c51da72 /libidu/scanners.c
parent3cda817f6cd73abfed5bdcc567735ad633904d41 (diff)
downloadidutils-79f0ffc240ee3fe6789a90ec01ae0503aced7927.tar.gz
idutils-79f0ffc240ee3fe6789a90ec01ae0503aced7927.tar.bz2
idutils-79f0ffc240ee3fe6789a90ec01ae0503aced7927.zip
Allocate safely.
* libidu/dynvec.c (make_dynvec, dynvec_freeze, dynvec_append): Use xnmalloc, not xmalloc (n * sizeof T). Use xnrealloc, not xrealloc (p, n * sizeof T). * libidu/walker.c (append_strings_to_vector, vectorize_string): Likewise. * libidu/scanners.c (tokenize_args_string): Likewise.
Diffstat (limited to 'libidu/scanners.c')
-rw-r--r--libidu/scanners.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libidu/scanners.c b/libidu/scanners.c
index c29b649..5789baa 100644
--- a/libidu/scanners.c
+++ b/libidu/scanners.c
@@ -307,7 +307,7 @@ tokenize_args_string (char *args_string, int *argcp, char ***argvp)
arg = strsep (&args_string, horizontal_space);
}
*argcp = argv - argv_0;
- *argvp = xrealloc (argv_0, sizeof(char *) * (*argcp));
+ *argvp = xnrealloc (argv_0, *argcp, sizeof **argvp);
}
static void