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:
Lexi Winter 2025-07-31 12:18:40 +01:00
parent 7a6d524a31
commit 250bb6793a

View file

@ -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]);
}
/**