mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
bsnmp: fix undefined behaviour
Modifying and using a variable without an intervening sequence point is undefined behaviour, which causes an error in the GCC build. Reviewed by: harti, emaste Differential Revision: https://reviews.freebsd.org/D51576
This commit is contained in:
parent
7a6d524a31
commit
250bb6793a
1 changed files with 3 additions and 1 deletions
|
|
@ -2096,7 +2096,9 @@ get_port(struct snmp_client *sc, const char *port[2])
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
return (port[1] = ++(port[0]) + strlen(port[0]));
|
||||
++port[0];
|
||||
port[1] = port[0] + strlen(port[0]);
|
||||
return (port[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue