summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-11-08 03:12:16 +0000
committerAndrew Tridgell <tridge@samba.org>2000-11-08 03:12:16 +0000
commit3adc0e7a4ee71d255d2181a928d6e632664b7f4c (patch)
treebb125e8375b463161191df44b4f67be42e77efa0 /source3/printing
parent1d3747e7f296c062854fe66fffa60c4ff83a2200 (diff)
downloadsamba-3adc0e7a4ee71d255d2181a928d6e632664b7f4c.tar.gz
samba-3adc0e7a4ee71d255d2181a928d6e632664b7f4c.tar.bz2
samba-3adc0e7a4ee71d255d2181a928d6e632664b7f4c.zip
an attempt to get the handling of fields in printer info structures
consistent. Still working with Jeremy on this, there is probably more to be done (This used to be commit c4bb9c598cf9781d48bc123a8cbbed9c2049bf89)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index c70a6891d4..3712cfbb14 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1431,9 +1431,8 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
ZERO_STRUCTP(nt_devmode);
- snprintf(adevice, sizeof(adevice), "\\\\%s\\%s", global_myname, default_devicename);
- fstrcpy(nt_devmode->devicename, adevice);
-
+ safe_strcpy(adevice, default_devicename, sizeof(adevice));
+ fstrcpy(nt_devmode->devicename, adevice);
fstrcpy(nt_devmode->formname, "Letter");
@@ -1663,8 +1662,10 @@ static uint32 get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstrin
snum = lp_servicenumber(sharename);
- fstrcpy(info.servername, global_myname);
- fstrcpy(info.printername, sharename);
+ slprintf(info.servername, sizeof(info.servername), "\\\\%s", global_myname);
+ slprintf(info.printername, sizeof(info.printername), "\\\\%s\\%s",
+ global_myname, sharename);
+ fstrcpy(info.sharename, sharename);
fstrcpy(info.portname, SAMBA_PRINTER_PORT_NAME);
fstrcpy(info.drivername, lp_printerdriver(snum));
pstrcpy(info.comment, "");