The execlp(or execl) system call has to be end with 0 to indicate the end of the argument list;For example
execlp(``ls'',''ls'');
execlp(``ls'',''ls'',(char*)0);