X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fod_bloaty.c;h=eb45798577919b57b1a1fd8daa97650a580ef9e4;hb=11a6f9b44f4a425b03e3a7a984e7b3e253e5f884;hp=a2eaf11d9a18d46c7f29ab81e6301f0895044762;hpb=a60f84ebf07863e390b72a2b6150e461a1ec18e9;p=oweals%2Fbusybox.git diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index a2eaf11d9..eb4579857 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c @@ -735,9 +735,9 @@ decode_format_string(const char *s) assert(s != next); s = next; + spec = xrealloc_vector(spec, 4, n_specs); + memcpy(&spec[n_specs], &tspec, sizeof(spec[0])); n_specs++; - spec = xrealloc(spec, n_specs * sizeof(*spec)); - memcpy(&spec[n_specs-1], &tspec, sizeof *spec); } }