quote:Original post by programering
char *adress;
adress = (char *)malloc(sizeof(path) + sizeof(name) + sizeof(format));
It should be
adress = (char *)malloc(sizeof(path) + sizeof(name) + sizeof(format)+1);
because C strings need an additional character for 0 termination