diff --git a/glslUtil/glslUtil.c b/glslUtil/glslUtil.c index caba5ff..16274e1 100644 --- a/glslUtil/glslUtil.c +++ b/glslUtil/glslUtil.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include "glslUtil.h" @@ -18,9 +17,9 @@ static char *loadFile(const char *fname) if (st.st_size <= 0) return NULL; char * buff = malloc(st.st_size + 1); - int fd = open(fname, O_RDONLY); - read(fd, buff, st.st_size); - close(fd); + FILE *fil = fopen(fname, "r"); + fread(buff, st.st_size, 1, fil); + fclose(fil); buff[st.st_size] = '\0'; return buff; }