fix: invalid memory access due to dereferencing after indexing

This commit is contained in:
2025-04-23 16:50:53 +02:00
parent f64db135a9
commit 9f6f20f36c

View File

@@ -59,7 +59,7 @@ static inline int str_put(char* restrict* restrict dest, size_t dest_len, char c
// copy the missing data to the end of the destination // copy the missing data to the end of the destination
memcpy(*dest + dest_len, src + dest_len, src_len - dest_len); memcpy(*dest + dest_len, src + dest_len, src_len - dest_len);
*dest[src_len] = '\0'; // null-terminate the destination (*dest)[src_len] = '\0'; // null-terminate the destination
return 0; return 0;
} }