git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e50c982
)
testprogs: fix REG_SZ in print_printer_data.
author
Günther Deschner
<gd@samba.org>
Tue, 2 Mar 2010 16:24:14 +0000
(17:24 +0100)
committer
Günther Deschner
<gd@samba.org>
Tue, 2 Mar 2010 18:03:16 +0000
(19:03 +0100)
Guenther
testprogs/win32/spoolss/printlib.c
patch
|
blob
|
history
diff --git
a/testprogs/win32/spoolss/printlib.c
b/testprogs/win32/spoolss/printlib.c
index c1eaeebe14e846bc20060a38f129293fe84e2a52..4cab09d44130f91cffc78693ea503812adf921ca 100644
(file)
--- 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("\tValue Name:\t%s\n", valuename);
- printf("\tSize:
0x%x (%d)\n", size, size);
+ printf("\tSize:
\t\t
0x%x (%d)\n", size, size);
printf("\tType:\t\t%s\n", reg_type_str(type));
printf("\tType:\t\t%s\n", reg_type_str(type));
+ if (buffer == NULL || size == 0) {
+ return;
+ }
+
switch (type) {
case REG_SZ:
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;
break;
case REG_MULTI_SZ:
p = (LPSTR)buffer;