summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2000-07-27 07:59:39 +0000
committerJean-François Micouleau <jfm@samba.org>2000-07-27 07:59:39 +0000
commit642ae912566d4e4f60fc5d78aecce114d6e3a849 (patch)
tree28cf63e8419344eb6376e0060fbf5089417035ab /source3/printing/nt_printing.c
parent5ec1642809d9de83da8c88c65d6595c6eb0270f5 (diff)
downloadsamba-642ae912566d4e4f60fc5d78aecce114d6e3a849.tar.gz
samba-642ae912566d4e4f60fc5d78aecce114d6e3a849.tar.bz2
samba-642ae912566d4e4f60fc5d78aecce114d6e3a849.zip
fix the devmode.orientation being set to 0.
that bug was *subtle* :-( J.F. (This used to be commit 0e9e048b6d65b57bdcc7440ddaa9d2cc1eac71dc)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 0161ee05e8..2fb1cbc998 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1257,6 +1257,7 @@ static void free_nt_printer_info_level_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr)
static int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen)
{
int len = 0;
+ int extra_len = 0;
NT_DEVICEMODE devmode;
ZERO_STRUCT(devmode);
@@ -1304,8 +1305,13 @@ static int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen)
&devmode.panningheight,
&devmode.private);
- if (devmode.private)
- len += tdb_unpack(buf+len, buflen-len, "B", &devmode.driverextra, &devmode.private);
+ if (devmode.private) {
+ /* the len in tdb_unpack is an int value and
+ * devmoce.driverextra is only a short
+ */
+ len += tdb_unpack(buf+len, buflen-len, "B", &extra_len, &devmode.private);
+ devmode.driverextra=(uint16)extra_len;
+ }
*nt_devmode = (NT_DEVICEMODE *)memdup(&devmode, sizeof(devmode));