summaryrefslogtreecommitdiff
path: root/src/od.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-11-04 06:32:51 +0000
committerJim Meyering <jim@meyering.net>2003-11-04 06:32:51 +0000
commit59436e7b92f75f6379568a397f13cba1df1eb0f2 (patch)
tree479f5342073dbd9eb37a179e5435d973f083246c /src/od.c
parent6ffc95a9e32aa394f75dfd67c79d3c2bd15c034a (diff)
downloadcoreutils-59436e7b92f75f6379568a397f13cba1df1eb0f2.tar.xz
(decode_format_string, dump_strings): Use x2nrealloc rather than xrealloc.
Diffstat (limited to 'src/od.c')
-rw-r--r--src/od.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/od.c b/src/od.c
index 7e03611f5..4978617c1 100644
--- a/src/od.c
+++ b/src/od.c
@@ -1040,8 +1040,7 @@ decode_format_string (const char *s)
if (n_specs >= n_specs_allocated)
{
- n_specs_allocated = 1 + (3 * n_specs_allocated) / 2;
- spec = xrealloc (spec, (n_specs_allocated * sizeof (struct tspec)));
+ spec = x2nrealloc (spec, &n_specs_allocated, sizeof (struct tspec));
}
memcpy ((char *) &spec[n_specs], (char *) &tspec,
@@ -1543,8 +1542,7 @@ dump_strings (void)
{
if (i == bufsize)
{
- bufsize = 1 + 3 * bufsize / 2;
- buf = xrealloc (buf, bufsize);
+ buf = x2nrealloc (buf, &bufsize, sizeof *buf);
}
err |= read_char (&c);
address++;
@@ -1666,8 +1664,8 @@ main (int argc, char **argv)
fp_type_size[sizeof (double)] = FLOAT_DOUBLE;
n_specs = 0;
- n_specs_allocated = 5;
- spec = xmalloc (n_specs_allocated * sizeof *spec);
+ n_specs_allocated = 0;
+ spec = NULL;
format_address = format_address_std;
address_base = 8;