[PATCH 04/16] pppd: 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.

Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>

Gbp-Pq: Name 0004-pppd-Fix-sign-extension-when-displaying-bytes-in-oct.patch
This commit is contained in:
Philip A. Prindeville 2014-12-19 17:52:58 -07:00 committed by openKylinBot
parent fca13df5dd
commit 49df16ab4a
1 changed files with 1 additions and 1 deletions

View File

@ -625,7 +625,7 @@ print_string(p, len, printer, arg)
printer(arg, "\\t");
break;
default:
printer(arg, "\\%.3o", c);
printer(arg, "\\%.3o", (unsigned char) c);
}
}
}