mirror of
https://github.com/dvorka/hstr.git
synced 2025-02-24 23:08:36 +08:00
Use strlen instead of sizeof
This commit is contained in:
parent
d0d346a094
commit
0198050483
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue