render: zero terminate shader code

shader-damage
Andri Yngvason 2019-10-28 18:10:32 +00:00
parent 3e2e31dde2
commit f6314ba4d6
1 changed files with 8 additions and 0 deletions

View File

@ -192,6 +192,14 @@ static char* read_file(const char* path)
if (ferror(stream))
goto read_failure;
if (rsize == size) {
contents = realloc(contents, size + 1);
if (!contents)
goto read_failure;
}
contents[rsize] = '\0';
fclose(stream);
return contents;