mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-13 17:00:44 +00:00
commit
0fd1435f4b
1 file changed
+1
-1
@@ -44,7 +44,7 @@ void doit(char *text)
|
||||
void dofile(char *filename)
|
||||
{
|
||||
FILE *f=fopen(filename,"rb");fseek(f,0,SEEK_END);long len=ftell(f);fseek(f,0,SEEK_SET);
|
||||
char *data=(char*)malloc(len+1);fread(data,1,len,f);fclose(f);
|
||||
char *data=(char*)malloc(len+1);fread(data,1,len,f);data[len]='\0';fclose(f);
|
||||
doit(data);
|
||||
free(data);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user