summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-10-24 13:46:35 +0000
committerjkh <jkh@FreeBSD.org>1995-10-24 13:46:35 +0000
commite405ad8dbdccc64b2173c1bfcb1dcaa1fca0ad59 (patch)
tree3dad90ce90994069455fe2e645ae322275a8bd91 /sbin
parent337307c9986cfd440353fe11affbf11152ca570d (diff)
downloadFreeBSD-src-e405ad8dbdccc64b2173c1bfcb1dcaa1fca0ad59.zip
FreeBSD-src-e405ad8dbdccc64b2173c1bfcb1dcaa1fca0ad59.tar.gz
Fix a silly bug where MAXPATHLEN was subtracted from the string length rather
than the other way around! Submitted by: Elmar Bartel <bartel@informatik.tu-muenchen.de>
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dump/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index 8c71021..995dee0 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -539,8 +539,8 @@ rawname(cp)
*dp = '\0';
(void)strncpy(rawbuf, cp, MAXPATHLEN - 1);
*dp = '/';
- (void)strncat(rawbuf, "/r", strlen(rawbuf) - (MAXPATHLEN - 1));
- (void)strncat(rawbuf, dp + 1, strlen(rawbuf) - (MAXPATHLEN - 1));
+ (void)strncat(rawbuf, "/r", MAXPATHLEN-1 - strlen(rawbuf));
+ (void)strncat(rawbuf, dp + 1, MAXPATHLEN-1 - strlen(rawbuf));
return (rawbuf);
}
OpenPOWER on IntegriCloud