почему строка allclear изменилась после sprintf (команда, "rm% s", newfile), я думаю, что "команда" не связана с "allclear"
(gdb) p allclear
$18 = "/home/river/Desktop/stage2/bin/config/02_allclear_12HD", '\000' <repeats 45 times>
(gdb) p &allclear
$19 = (char (*)[100]) 0xbfffea0c
(gdb) p &command
$20 = (char (*)[50]) 0xbfffe9da
**(gdb) n
65 sprintf( command, "rm %s", newfile );**
(gdb) p allclear
$21 = "/home/river/Desktop/stage2/bin/config/02_allclear_12HD", '\000' <repeats 45 times>
(gdb) n
66 if( argc < 1) return 1;
**(gdb) p allclear
$22 = "001005/controlpage\000/stage2/bin/config/02_allclear_12HD", '\000' <repeats 45 times>**
(gdb) p $allclear
$23 = void
(gdb) p &allclear
$24 = (char (*)[100]) 0xbfffea0c
(gdb) p newfile
$25 = "/home/river/Desktop/stage2/test_case/01_SES/SES001005/controlpage", '\000' <repeats 34 times>
(gdb) p &command
$26 = (char (*)[50]) 0xbfffe9da
какая-то часть моего кода:
char allclear[MAXPATHSIZE];
memset( allclear, 0, MAXPATHSIZE);
sprintf( allclear, "%s/config/02_allclear_12HD", curfilepathdir);
char command[MAXCOMMAMDSIZE];
memset( command, 0, MAXCOMMAMDSIZE);
sprintf( command, "rm %s", newfile );