summaryrefslogtreecommitdiffstats
path: root/source/nmbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-08 20:22:55 +0000
committerJeremy Allison <jra@samba.org>2001-04-08 20:22:55 +0000
commite5c1683ff4fe895bacd439772641ef5b1ecbfb31 (patch)
treebea1a3d61344b664771c6cead67e80aa6a75dfd2 /source/nmbd
parent1efaa36271ae0d28f26a5c298938ea2fc2d80815 (diff)
downloadsamba-e5c1683ff4fe895bacd439772641ef5b1ecbfb31.tar.gz
samba-e5c1683ff4fe895bacd439772641ef5b1ecbfb31.tar.xz
samba-e5c1683ff4fe895bacd439772641ef5b1ecbfb31.zip
Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
Diffstat (limited to 'source/nmbd')
-rw-r--r--source/nmbd/nmbd.c2
-rw-r--r--source/nmbd/nmbd_winsserver.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index 32d66d39fd5..46f6056e7c0 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -668,7 +668,7 @@ static void usage(char *pname)
TimeInit();
- slprintf(debugf, sizeof(debugf), "%s/log.nmbd", LOGFILEBASE);
+ slprintf(debugf, sizeof(debugf)-1, "%s/log.nmbd", LOGFILEBASE);
setup_logging( argv[0], False );
charset_initialise();
diff --git a/source/nmbd/nmbd_winsserver.c b/source/nmbd/nmbd_winsserver.c
index 33b33040cb2..454b2170aa7 100644
--- a/source/nmbd/nmbd_winsserver.c
+++ b/source/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)
{