Use strlen instead of sizeof

This commit is contained in:
Ryan Baumann 2015-02-23 12:51:43 -05:00
parent d0d346a094
commit 0198050483

View file

@ -149,7 +149,7 @@ char *get_process_name_by_pid(const int pid)
char* shell = strrchr(getenv("SHELL"),'/');
if(shell != NULL){
shell++;
strncpy(name,shell,sizeof(char)*sizeof(name));
strncpy(name,shell,sizeof(char)*strlen(shell));
}
}
return name;