Also copy null termination
Signed-off-by: tyrolyean <tyrolyean@tyrolyean.net>
This commit is contained in:
parent
8b0210010d
commit
71a4208434
1 changed files with 2 additions and 1 deletions
|
@ -39,7 +39,8 @@ char* insert_string(char * destination, const char* source,
|
|||
/* Out of memory... Failed me.. */
|
||||
return NULL;
|
||||
}
|
||||
memmove(result+offset+src_len, result+offset, dest_orig_len - offset);
|
||||
memmove(result+offset+src_len, result+offset,
|
||||
(dest_orig_len - offset+1));
|
||||
memcpy(result+offset, source, src_len);
|
||||
return result;
|
||||
|
||||
|
|
Loading…
Reference in a new issue