mirror of
https://github.com/IllusionMan1212/cudoku.git
synced 2026-10-24 02:12:25 +00:00
fix: null terminate the shader string buffers
This commit is contained in:
@@ -18,6 +18,7 @@ void read_shader_file(const char *path, char **buf) {
|
|||||||
fseek(fp, 0, SEEK_SET);
|
fseek(fp, 0, SEEK_SET);
|
||||||
|
|
||||||
*buf = malloc(filesize + 1);
|
*buf = malloc(filesize + 1);
|
||||||
|
(*buf)[filesize] = '\0';
|
||||||
|
|
||||||
|
|
||||||
size_t bytes_read = fread(*buf, filesize, 1, fp);
|
size_t bytes_read = fread(*buf, filesize, 1, fp);
|
||||||
|
|||||||
Reference in New Issue
Block a user