aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/common.c')
-rw-r--r--src/lib/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/common.c b/src/lib/common.c
index fd3ab7071..8ea926df1 100644
--- a/src/lib/common.c
+++ b/src/lib/common.c
@@ -137,7 +137,7 @@ char *pid_proc_comm(const pid_t pid) {
137 free(fname); 137 free(fname);
138 138
139 // read file 139 // read file
140 unsigned char buffer[BUFLEN]; 140 char buffer[BUFLEN];
141 ssize_t len; 141 ssize_t len;
142 if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) { 142 if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) {
143 close(fd); 143 close(fd);
@@ -152,7 +152,7 @@ char *pid_proc_comm(const pid_t pid) {
152 *ptr = '\0'; 152 *ptr = '\0';
153 153
154 // return a malloc copy of the command line 154 // return a malloc copy of the command line
155 char *rv = strdup((char *) buffer); 155 char *rv = strdup(buffer);
156 if (strlen(rv) == 0) { 156 if (strlen(rv) == 0) {
157 free(rv); 157 free(rv);
158 return NULL; 158 return NULL;