From 9a0ffa8cbe91de3f2b3fad7719fc440b97ba66a9 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 29 Apr 2011 17:24:01 -0400 Subject: [PATCH] kinda forgot the point of loadFile() --- template/test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/test.cc b/template/test.cc index b720da6..0fad8fb 100644 --- a/template/test.cc +++ b/template/test.cc @@ -1,6 +1,7 @@ #define GL_GLEXT_PROTOTYPES #include +#include #include #include #include @@ -21,6 +22,9 @@ char * loadFile(const char *fname) if (st.st_size <= 0) return NULL; char * buff = new char[st.st_size + 1]; + int fd = open(fname, O_RDONLY); + read(fd, buff, st.st_size); + close(fd); buff[st.st_size] = '\0'; return buff; }