summaryrefslogtreecommitdiff
path: root/testprogs/win32/spoolss/printlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'testprogs/win32/spoolss/printlib.c')
-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;