Hi all,
for my little program i need a check for input of "cd" the change direction command in linux.
for some reason, this code is giving me a segmentation fault when myarray contains nothing...
ie nothing was entered from the user.
the code works...but when the array contains nothing it seg faults.Code:if(strcmp(myarray[0],"cd") == 0) { chdir(myarray[1]); }
any suggestions would be greatly appreciated.
techevo