Merge remote-tracking branch 'upstream/dev' into single-file-lib

This commit is contained in:
Carl Woffenden committed 2020-04-07 11:13:02 +02:00
commit 7af7735fa3
7 files changed
+119 -39

No files matched your search

@@ -100,11 +100,14 @@ static char* readFile(const char* filename, size_t* size) {
buf = malloc(*size);
if (buf == NULL) {
fprintf(stderr, "malloc failed\n");
fclose(f);
return NULL;
}
bytes_read = fread(buf, 1, *size, f);
if (bytes_read != *size) {
fprintf(stderr, "failed to read whole file\n");
fclose(f);
free(buf);
return NULL;
}