summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_sendannounce.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-23 13:27:35 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-23 13:27:35 +0000
commit2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea (patch)
tree44885a8b68275050bed851eca36937f19317eb3e /source3/nmbd/nmbd_sendannounce.c
parent13b54b9cfad9519f63f35fa284ce1c82b73d656a (diff)
downloadsamba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.tar.gz
samba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.tar.bz2
samba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.zip
Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted
a pstrcpy/fstrcpy or at most a safe_strcpy(). These have the advantage of being compiler-verifiable. Get these out of the way, along with a rewrite of 'get_short_archi' in the spoolss client and server. (This pushes around const string pointers, rather than copied strings). Andrew Bartlett (This used to be commit 32fb801ddc035e8971e9911ed4b6e51892e9d1cc)
Diffstat (limited to 'source3/nmbd/nmbd_sendannounce.c')
-rw-r--r--source3/nmbd/nmbd_sendannounce.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c
index 40d07aae16..8501acf9ba 100644
--- a/source3/nmbd/nmbd_sendannounce.c
+++ b/source3/nmbd/nmbd_sendannounce.c
@@ -555,6 +555,7 @@ void browse_sync_remote(time_t t)
struct work_record *work;
pstring outbuf;
char *p;
+ fstring myname;
if (last_time && (t < (last_time + REMOTE_ANNOUNCE_INTERVAL)))
return;
@@ -589,8 +590,11 @@ for workgroup %s on subnet %s.\n", lp_workgroup(), FIRST_SUBNET->subnet_name ));
SCVAL(p,0,ANN_MasterAnnouncement);
p++;
- StrnCpy(p,global_myname(),15);
- strupper(p);
+ fstrcpy(myname, global_myname());
+ strupper(myname);
+ myname[15]='\0';
+ push_pstring_base(p, myname, outbuf);
+
p = skip_string(p,1);
for (ptr=s; next_token(&ptr,s2,NULL,sizeof(s2)); )