s3:lib fix output of hex escapes > 0x7F with cbuf_print_quoted
authorGregor Beck <gbeck@sernet.de>
Fri, 21 Oct 2011 08:49:45 +0000 (10:49 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 25 Nov 2011 12:24:34 +0000 (13:24 +0100)
(cherry picked from commit a1fcb7e37a23dcc035686486d4afe32a67082ae1)

source3/lib/cbuf.c

index 42353f8f644a540d09927070311dd134161b2e37..611aa80609f375d402fa56f0654efb6718573d08 100644 (file)
@@ -306,7 +306,7 @@ int cbuf_print_quoted(cbuf* ost, const char* s, size_t len)
                        if (isprint(*s) && ((*s == ' ') || !isspace(*s))) {
                                ret = cbuf_putc(ost, *s);
                        } else {
-                               ret = cbuf_printf(ost, "\\%02x", *s);
+                               ret = cbuf_printf(ost, "\\%02x", (uchar)*s);
                        }
                }
                s++;