diff options
author | netblue30 <netblue30@yahoo.com> | 2016-03-10 12:14:39 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-03-10 12:14:39 -0500 |
commit | 4d66d7f70eed99aeadce7c50674eebe3c6d3ed66 (patch) | |
tree | a57c77042c0d42dd450f47e8491101f4ed3f525f /src/lib/common.c | |
parent | Merge pull request #363 from ligthyear/fixing-exit-code (diff) | |
download | firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.tar.gz firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.tar.zst firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.zip |
cleanup
Diffstat (limited to 'src/lib/common.c')
-rw-r--r-- | src/lib/common.c | 4 |
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; |