mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-05 15:39:54 +00:00
PPP, from PPPD upstream: fix sign-extension when displaying bytes in octal
print_string() displays characters as \\%.03o but without first casting it from "char" to "unsigned char" so it gets sign-extended to an int. This causes output like \37777777630 instead of \230. (Based from pppd commit 5e8c3cb256a7e86e3572a82a75d51c6850efdbdc)
This commit is contained in:
parent
b438a0d6fd
commit
d4f824398c
@ -591,7 +591,7 @@ void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const c
|
||||
printer(arg, "\\t");
|
||||
break;
|
||||
default:
|
||||
printer(arg, "\\%.3o", c);
|
||||
printer(arg, "\\%.3o", (u8_t)c);
|
||||
/* no break */
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user