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.

Code:
if(strcmp(myarray[0],"cd") == 0) 
{
	chdir(myarray[1]);
}
the code works...but when the array contains nothing it seg faults.

any suggestions would be greatly appreciated.

techevo