From 1cd5b3c20c42c916609e30061fd815bff0088f46 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 15 Dec 2023 00:33:37 +0200 Subject: [PATCH] LibC: Fix stpncpy I had misunderstood and tought that the string is always null terminated --- libc/string.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libc/string.cpp b/libc/string.cpp index 49f60c1a..44c088aa 100644 --- a/libc/string.cpp +++ b/libc/string.cpp @@ -89,7 +89,6 @@ char* stpncpy(char* __restrict__ dest, const char* __restrict__ src, size_t n) dest[i] = src[i]; for (; n; i++, n--) dest[i] = '\0'; - dest[i] = '\0'; return &dest[i]; }