mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Update test.c
This commit is contained in:
parent
2ffefcec73
commit
4132e9301d
2
test.c
2
test.c
@ -44,7 +44,7 @@ void doit(char *text)
|
|||||||
void dofile(char *filename)
|
void dofile(char *filename)
|
||||||
{
|
{
|
||||||
FILE *f=fopen(filename,"rb");fseek(f,0,SEEK_END);long len=ftell(f);fseek(f,0,SEEK_SET);
|
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);
|
doit(data);
|
||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user