Skip to content

Commit 90b7579

Browse files
committed
memcopy
1 parent 5f02a5b commit 90b7579

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## CHANGELOG
22

3+
### v0.1.2 (2020-05-31)
4+
5+
* Memory copy changes to improve stability and performance.
6+
37
### v0.1.1 (2020-04-23)
48

59
* New string_buffer_is_released function.

src/string_buffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ char *string_buffer_to_string(struct StringBuffer *buffer)
280280
}
281281

282282
buffer->value[content_size] = 0;
283+
string_copy[content_size] = 0;
283284

284-
string_copy = strncpy(string_copy, buffer->value, content_size);
285+
memcpy(string_copy, buffer->value, memory_size);
285286
string_copy[content_size] = 0;
286287

287288
return(string_copy);

0 commit comments

Comments
 (0)