loop body is not enclosed in { }
42
43 int *ptr[ALLOC] = { NULL };
44
45 for (uint i = 0; i < ALLOC; i++) 46 ptr[i] = malloc(sizeof(int) * 64); 47
48 show_alloc_mem();
49
loop body is not enclosed in { }
47
48 show_alloc_mem();
49
50 for (uint i = 0; i < ALLOC; i++) 51 free(ptr[i]); 52
53 show_alloc_mem();
54}
Description
Loop body not being enclosed in {}
can make it confusing and hard to read,
hence consider using {}
for loop body.
Bad practice
int x = 0;
while (x < 10) x++;
Recommended
int x = 0;
while (x < 10) {
x++;
}