From abdec3e35c5451782c26b6ed8ef92c520c96ce15 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Tue, 24 Oct 1995 13:46:35 +0000 Subject: [PATCH] Fix a silly bug where MAXPATHLEN was subtracted from the string length rather than the other way around! Submitted by: Elmar Bartel --- sbin/dump/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 8c710218606..995dee0f502 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); }