An existing comment in the function being updated explains the problem:
* Many of the sscanf calls in this function use oversized destination
* fields because some sscanf() implementations truncate the range of %i
* directives, so that e.g. "%"SCNi16 interprets input of "0xfedc" as a
* value of 0x7fff. The other alternatives are to allow only a single
* radix (e.g. decimal or hexadecimal) or to write more sophisticated
* parsers.
}
{
- uint16_t eth_type;
+ int eth_type;
int n = -1;
- if (sscanf(s, "eth_type(%"SCNi16")%n", ð_type, &n) > 0 && n > 0) {
+ if (sscanf(s, "eth_type(%i)%n", ð_type, &n) > 0 && n > 0) {
nl_msg_put_be16(key, ODP_KEY_ATTR_ETHERTYPE, htons(eth_type));
return n;
}