r5356: fixed the hex coding for nbt names
authorAndrew Tridgell <tridge@samba.org>
Sat, 12 Feb 2005 03:10:50 +0000 (03:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:45 +0000 (13:09 -0500)
(This used to be commit e467715c63624e165b79b37bd21b381d7a99d0fe)

source4/libcli/nbt/nbtname.c

index da5205d818cb67d6e71dbee11a4d986dd7e3f046..adc66980c4fa23a9ed6e639d9da0ab20c5736a36 100644 (file)
@@ -346,7 +346,7 @@ static const char *nbt_hex_encode(TALLOC_CTX *mem_ctx, const char *s)
                if (isalnum(s[i]) || strchr(valid_chars, s[i])) {
                        ret[len++] = s[i];
                } else {
-                       snprintf(&ret[len], 3, "%02x", s[i]);
+                       snprintf(&ret[len], 4, "%%%02x", (unsigned char)s[i]);
                        len += 3;
                }
        }