From 019805048372adb5b43c1f8b90482d35f639502f Mon Sep 17 00:00:00 2001 From: Ryan Baumann Date: Mon, 23 Feb 2015 12:51:43 -0500 Subject: [PATCH] Use strlen instead of sizeof --- src/hstr_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hstr_utils.c b/src/hstr_utils.c index 9a2104e..554c548 100644 --- a/src/hstr_utils.c +++ b/src/hstr_utils.c @@ -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;