mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 07:07:04 +02:00
BUILD: mworker: always initialize the saveptr of strtok_r()
Building with some libcs which define strtok_r() as an inline function can yield a possibly uninitialized warning due to a loop dereferencing this save pointer early, even though the doc clearly mentions that it is ignored. This is actually more of a mismatch between the compiler and the libc (gcc-4.7 and glibc-2.23 in that case). It's trivial to set s2 to NULL here so let's do it to please this old couple. Note that while the warning is triggered in all supported versions, there's no point backporting it since it's unlikely this combination will be relevant outside of backwards compatibility checks now.
This commit is contained in:
parent
f78121dd32
commit
21df7677a9
@ -175,7 +175,7 @@ int mworker_env_to_proc_list()
|
||||
|
||||
while ((token = strtok_r(msg, "|", &s1))) {
|
||||
char *subtoken = NULL;
|
||||
char *s2;
|
||||
char *s2 = NULL;
|
||||
|
||||
msg = NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user