chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
basic/process-util: we need to take the shorter of two strings
[elogind.git]
/
src
/
basic
/
process-util.c
diff --git
a/src/basic/process-util.c
b/src/basic/process-util.c
index 359c3a4e4e00dfd015c2802ffd1e1e37ff227704..09bc12a80afb75346fd8f10df6cb831aa95e437c 100644
(file)
--- a/
src/basic/process-util.c
+++ b/
src/basic/process-util.c
@@
-682,7
+682,7
@@
int getenv_for_pid(pid_t pid, const char *field, char **_value) {
}
line[i] = 0;
- if (
memcmp(line, field, l) == 0
&& line[l] == '=') {
+ if (
strneq(line, field, l)
&& line[l] == '=') {
value = strdup(line + l + 1);
if (!value)
return -ENOMEM;