about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/util/nstring.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/util/nstring.h b/lib/util/nstring.h
index 8829617d..ee997ab4 100644
--- a/lib/util/nstring.h
+++ b/lib/util/nstring.h
@@ -22,11 +22,11 @@ extern "C" {
    array.
 */
 #define STRSCPY(A,B) \
-	(strncpy((A), (B), sizeof(A)), *((A)+sizeof(A)-1) = '\0')
+	(strncpy((A), (B), sizeof(A)-1), *((A)+sizeof(A)-1) = '\0')
 #define STRSCMP(A,B) \
 	(strncmp((A), (B), sizeof(A)))
 #define STRSCAT(A,B) \
-    (strncpy(A+strlen(A), B, sizeof(A)-strlen(A)), *((A)+sizeof(A)-1) = '\0')
+    (strncpy(A+strlen(A), B, sizeof(A)-strlen(A)-1), *((A)+sizeof(A)-1) = '\0')
 #define STRSEQ(A, B) \
 	(strneq((A), (B), sizeof(A)))