[Solved] Unpredictable behavior for strcpy(m+1,m)


This causes undefined behaviour. strcpy may only be used between areas that do not overlap.

To fix this code you could write:

memmove(m+1, m, strlen(m) + 1);

solved Unpredictable behavior for strcpy(m+1,m)