From 6f7001889232804dac45a066347fd0c1a3f7552a Mon Sep 17 00:00:00 2001 From: IllusionMan1212 Date: Fri, 8 Sep 2023 20:49:38 +0200 Subject: [PATCH] fix: null terminate the shader string buffers --- shader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shader.c b/shader.c index 3946250..18d3639 100644 --- a/shader.c +++ b/shader.c @@ -18,6 +18,7 @@ void read_shader_file(const char *path, char **buf) { fseek(fp, 0, SEEK_SET); *buf = malloc(filesize + 1); + (*buf)[filesize] = '\0'; size_t bytes_read = fread(*buf, filesize, 1, fp);