diff options
author | Karel Zak | 2012-08-08 08:58:28 +0200 |
---|---|---|
committer | Karel Zak | 2012-08-08 08:58:28 +0200 |
commit | 33e785491b073ffe8a5f7546d214b8340ad29394 (patch) | |
tree | 0d55521959583bdb12f9de12b8b06f7fb4bd1aed /lib | |
parent | include/tt: improve work with non-utf8 chars (diff) | |
download | kernel-qcow2-util-linux-33e785491b073ffe8a5f7546d214b8340ad29394.tar.gz kernel-qcow2-util-linux-33e785491b073ffe8a5f7546d214b8340ad29394.tar.xz kernel-qcow2-util-linux-33e785491b073ffe8a5f7546d214b8340ad29394.zip |
lib/tt: fix \x%02x usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tt.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -670,14 +670,14 @@ void tt_fputs_quoted(const char *data, FILE *out) !isprint((unsigned char) *p) || iscntrl((unsigned char) *p)) { - fprintf(out, "\\x%02x", *p); + fprintf(out, "\\x%02x", (unsigned char) *p); } else if (*p == '\\' && *(p + 1) == 'x' && isxdigit((unsigned char) *(p + 2)) && isxdigit((unsigned char) *(p + 3))) { - fprintf(out, "\\x%02x", *p); + fprintf(out, "\\x%02x", (unsigned char) *p); } else fputc(*p, out); } @@ -693,14 +693,14 @@ void tt_fputs_nonblank(const char *data, FILE *out) !isprint((unsigned char) *p) || iscntrl((unsigned char) *p)) { - fprintf(out, "\\x%02x", *p); + fprintf(out, "\\x%02x", (unsigned char) *p); } else if (*p == '\\' && *(p + 1) == 'x' && isxdigit((unsigned char) *(p + 2)) && isxdigit((unsigned char) *(p + 3))) { - fprintf(out, "\\x%02x", *p); + fprintf(out, "\\x%02x", (unsigned char) *p); } else fputc(*p, out); } |