diff options
author | Jeremy Allison <jra@samba.org> | 2001-04-08 20:22:39 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-04-08 20:22:39 +0000 |
commit | f9a15ce1a69f905e94db7650f0a4805720cd9c88 (patch) | |
tree | ee37b735477fe7eaea7cb16a30d126971aae8d5b /source3/nmbd/nmbd_winsserver.c | |
parent | 607d5d508d091d6c9b9cd6549b2a89f7359d780c (diff) | |
download | samba-f9a15ce1a69f905e94db7650f0a4805720cd9c88.tar.gz samba-f9a15ce1a69f905e94db7650f0a4805720cd9c88.tar.bz2 samba-f9a15ce1a69f905e94db7650f0a4805720cd9c88.zip |
Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639ed9b19f7d0fb896e43aa392a84989a)
Diffstat (limited to 'source3/nmbd/nmbd_winsserver.c')
-rw-r--r-- | source3/nmbd/nmbd_winsserver.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 33b33040cb..454b2170aa 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -50,7 +50,7 @@ static void wins_hook(char *operation, struct name_record *namerec, int ttl) } p = command; - p += slprintf(p, sizeof(command), "%s %s %s %02x %d", + p += slprintf(p, sizeof(command)-1, "%s %s %s %02x %d", cmd, operation, namerec->name.name, @@ -58,7 +58,7 @@ static void wins_hook(char *operation, struct name_record *namerec, int ttl) ttl); for (i=0;i<namerec->data.num_ips;i++) { - p += slprintf(p, sizeof(command) - (p-command), " %s", inet_ntoa(namerec->data.ip[i])); + p += slprintf(p, sizeof(command) - (p-command) -1, " %s", inet_ntoa(namerec->data.ip[i])); } DEBUG(3,("calling wins hook for %s\n", nmb_namestr(&namerec->name))); @@ -1597,9 +1597,9 @@ void wins_write_database(BOOL background) } } - slprintf(fname,sizeof(fname),"%s/%s", lp_lockdir(), WINS_LIST); + slprintf(fname,sizeof(fname)-1,"%s/%s", lp_lockdir(), WINS_LIST); all_string_sub(fname,"//", "/", 0); - slprintf(fnamenew,sizeof(fnamenew),"%s.%u", fname, (unsigned int)sys_getpid()); + slprintf(fnamenew,sizeof(fnamenew)-1,"%s.%u", fname, (unsigned int)sys_getpid()); if((fp = sys_fopen(fnamenew,"w")) == NULL) { |