From 9e6003a0d2f227fcf4976db6b8b8838437330b38 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 9 May 2011 17:31:02 -0400 Subject: [PATCH] use stdio i/o functions --- glslUtil/glslUtil.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; }