I was expecting a segfault with this code:
char * foo (char my_ascii[10]) { strcpy (my_ascii, "0123456789"); return my_ascii; } char bar[2]; printf("%s\n", foo (bar));
I have a function which takes an array of strings (buffer) and needs to increase its size. So I invoke a realloc
temp = (char**) realloc (buffer, newSize * (sizeof(char*))); if (temp == NULL) ...