Reserver room for the trailing NUL byte, too
authoraland <aland>
Wed, 28 Jan 2004 17:08:48 +0000 (17:08 +0000)
committeraland <aland>
Wed, 28 Jan 2004 17:08:48 +0000 (17:08 +0000)
src/main/valuepair.c

index 32dc3ec..1c9374b 100644 (file)
@@ -499,7 +499,7 @@ static int presufcmp(void *instance,
                        ret = strcmp(name + namelen - len,
                                        (char *)check->strvalue);
                        if (ret == 0 && rest) {
-                               strNcpy(rest, name, namelen - len);
+                               strNcpy(rest, name, namelen - len + 1);
                        }
                        break;
        }