Replace sizeof('\0') with sizeof("")

Because sizeof('\0') is actually sizeof(int) not sizeof(char).
This commit is contained in:
Max Bruckner committed 2017-04-08 01:29:19 +02:00
1 parent ab8489a851
commit 84237ff48e
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@ CJSON_PUBLIC(char*) read_file(const char *filename)
}
/* allocate content buffer */
content = (char*)malloc((size_t)length + sizeof('\0'));
content = (char*)malloc((size_t)length + sizeof(""));
if (content == NULL)
{
goto cleanup;