diff --git a/x_string/src/x_string.c b/x_string/src/x_string.c index 20d1674..39c4e3d 100644 --- a/x_string/src/x_string.c +++ b/x_string/src/x_string.c @@ -64,7 +64,7 @@ char* x_strconcat(char* str1, char* str2){ int len1 = x_strlen(str1); int len2 = x_strlen(str2); - int new_length = len1 + len2; + int new_length = len1 + len2 + 1; new_string = malloc( sizeof(*new_string) * new_length ); x_strcpy(new_string, str1, new_length);