diff --git a/man1/memusage.1 b/man1/memusage.1 index a03468442..78d338db9 100644 --- a/man1/memusage.1 +++ b/man1/memusage.1 @@ -245,10 +245,12 @@ int main(int argc, char *argv[]) { int i, j; + size_t size; int *p; - printf("malloc: %zd\en", sizeof(*p) * 100); - p = malloc(sizeof(*p) * 100); + size = sizeof(*p) * 100; + printf("malloc: %zd\en", size); + p = malloc(size); for (i = 0; i < CYCLES; i++) { if (i < CYCLES / 2) @@ -256,11 +258,13 @@ main(int argc, char *argv[]) else j--; - printf("realloc: %zd\en", sizeof(*p) * (j * 50 + 110)); - p = realloc(p, sizeof(*p) * (j * 50 + 100)); + size = sizeof(*p) * (j * 50 + 110); + printf("realloc: %zd\en", size); + p = realloc(p, size); - printf("realloc: %zd\en", sizeof(*p) * ((j+1) * 150 + 110)); - p = realloc(p, sizeof(*p) * ((j + 1) * 150 + 110)); + size = sizeof(*p) * ((j + 1) * 150 + 110); + printf("realloc: %zd\en", size); + p = realloc(p, size); } free(p);