Originally Posted by
pfs
The thing is that
it isn't even being used inside of
Code:
int my_function2(int pc, char **plist);
.
Then it isn't crashing. I mean, you can run this code all day long:
Code:
int my_function2(int pc, char **plist) {
return 0;
}
int my_function1(int pc, char **plist) {
char *this_plist[3];
this_plist[0] = plist[0];
this_plist[1] = "I_changed_this";
this_plist[2] = NULL;
my_function2(3, this_plist);
return 0;
}
int main() {
char *list[3];
my_function1(3, list);
return 0;
}
and it won't crash. You don't have to take my word for it, you can run it yourself. Now if you try to touch this_plist[2] at all inside my_function2, even just to try to print it or do something like this_plist[2][0] then you're in trouble. But if you don't touch it it won't crash.