From 8aa72e4f3c1c4d060c64136abf7b165afeddd5bc Mon Sep 17 00:00:00 2001 From: Gorsky Kirill Date: Sat, 10 Feb 2024 01:12:54 +0300 Subject: [PATCH] char* --> char --- examples/ex-sizeof/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ex-sizeof/main.c b/examples/ex-sizeof/main.c index 7b3372d..e65df9b 100644 --- a/examples/ex-sizeof/main.c +++ b/examples/ex-sizeof/main.c @@ -14,13 +14,13 @@ int forgot_parens() size_t capacity = BLOCK_SIZE; size_t size = 0; - char *str = (char *)malloc(capacity * sizeof(char*)); + char *str = (char *)malloc(capacity * sizeof(char)); while (1) { char c = getchar(); if (c == EOF) break; if (size == capacity) { - str = (char *)realloc(str, capacity + BLOCK_SIZE * sizeof(char*)); + str = (char *)realloc(str, capacity + BLOCK_SIZE * sizeof(char)); capacity += BLOCK_SIZE; }