summaryrefslogtreecommitdiff
path: root/testprogs/win32
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-02 17:24:14 +0100
committerGünther Deschner <gd@samba.org>2010-03-02 19:03:16 +0100
commitf73c27116c60e492158c6d40823691c38a290a94 (patch)
tree94c40012a2963a493ff5fc171da4721a6f4eadf8 /testprogs/win32
parente50c9826794f4a80b7200712afacb0752ccf8d6f (diff)
downloadsamba-f73c27116c60e492158c6d40823691c38a290a94.tar.gz
samba-f73c27116c60e492158c6d40823691c38a290a94.tar.bz2
samba-f73c27116c60e492158c6d40823691c38a290a94.zip
testprogs: fix REG_SZ in print_printer_data.
Guenther
Diffstat (limited to 'testprogs/win32')
-rw-r--r--testprogs/win32/spoolss/printlib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/testprogs/win32/spoolss/printlib.c b/testprogs/win32/spoolss/printlib.c
index c1eaeebe14..4cab09d441 100644
--- a/testprogs/win32/spoolss/printlib.c
+++ b/testprogs/win32/spoolss/printlib.c
@@ -1168,12 +1168,20 @@ void print_printer_data(LPSTR keyname, LPSTR valuename, DWORD size, LPBYTE buffe
}
printf("\tValue Name:\t%s\n", valuename);
- printf("\tSize: 0x%x (%d)\n", size, size);
+ printf("\tSize:\t\t0x%x (%d)\n", size, size);
printf("\tType:\t\t%s\n", reg_type_str(type));
+ if (buffer == NULL || size == 0) {
+ return;
+ }
+
switch (type) {
case REG_SZ:
- printf("\t\t%s\n", (LPSTR)buffer);
+ printf("\t\t");
+ for (i=0; i < size; i++) {
+ printf("%c", buffer[i]);
+ }
+ printf("\n");
break;
case REG_MULTI_SZ:
p = (LPSTR)buffer;