summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-03-06 16:09:11 +0000
committerGerald Carter <jerry@samba.org>2003-03-06 16:09:11 +0000
commit52ef84b53495db1eac6ecfb0b926ef8df7ea5cc5 (patch)
treeaec19c7ee02a52c6c4c5f3eb9d174be7421a45dc /source
parent214decbda680f23691f0d633d4a29c2c7e17de6b (diff)
downloadsamba-52ef84b53495db1eac6ecfb0b926ef8df7ea5cc5.tar.gz
samba-52ef84b53495db1eac6ecfb0b926ef8df7ea5cc5.tar.xz
samba-52ef84b53495db1eac6ecfb0b926ef8df7ea5cc5.zip
add #define for the max device name length in a DEVICEMODE
Diffstat (limited to 'source')
-rw-r--r--source/include/nt_printing.h2
-rw-r--r--source/printing/nt_printing.c2
-rw-r--r--source/rpc_parse/parse_spoolss.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/source/include/nt_printing.h b/source/include/nt_printing.h
index ca65a40d488..762b1c69170 100644
--- a/source/include/nt_printing.h
+++ b/source/include/nt_printing.h
@@ -255,6 +255,8 @@ typedef struct {
NT_PRINTER_KEY *keys;
} NT_PRINTER_DATA;
+#define MAXDEVICENAME 32
+
typedef struct ntdevicemode
{
fstring devicename;
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index fd1f847a218..74a9ac8174a 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -2110,7 +2110,7 @@ done:
NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
{
- char adevice[32];
+ char adevice[MAXDEVICENAME];
NT_DEVICEMODE *nt_devmode = (NT_DEVICEMODE *)malloc(sizeof(NT_DEVICEMODE));
if (nt_devmode == NULL) {
diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c
index 0545f89ff7a..a5d2087a3a3 100644
--- a/source/rpc_parse/parse_spoolss.c
+++ b/source/rpc_parse/parse_spoolss.c
@@ -684,7 +684,7 @@ BOOL spoolss_io_devmode(const char *desc, prs_struct *ps, int depth, DEVICEMODE
return False;
}
- if (!prs_uint16uni(True,"devicename", ps, depth, devmode->devicename.buffer, 32))
+ if (!prs_uint16uni(True,"devicename", ps, depth, devmode->devicename.buffer, MAXDEVICENAME))
return False;
if (!prs_uint16("specversion", ps, depth, &devmode->specversion))