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:
Sylvain Rochet 2016-07-02 16:55:57 +02:00
parent b438a0d6fd
commit d4f824398c

View File

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