don't pass NULL to memcpy

This commit is contained in:
Sunrim KIM (keen) 2015-05-31 21:26:06 +09:00
parent 83a84c3582
commit 6e9024b237
1 changed files with 1 additions and 1 deletions

View File

@ -133,9 +133,9 @@ string_open(pic_state *pic, const char *data, size_t size)
m->end = size;
m->capa = size;
memcpy(m->buf, data, size);
if (data != NULL) {
memcpy(m->buf, data, size);
file = xfunopen(m, string_read, NULL, string_seek, string_close);
} else {
file = xfunopen(m, NULL, string_write, string_seek, string_close);