use stdio i/o functions
This commit is contained in:
parent
956f249d54
commit
9e6003a0d2
@ -2,7 +2,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user