#include <unistd.h>
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <memory.h>
|
||||||
#include "cJSON.c"
|
#include "cJSON.c"
|
||||||
|
|
||||||
char *nonportable_path(char *str)
|
char *nonportable_path(char *str)
|
||||||
@@ -55,7 +56,7 @@ void *loadfile(char *fname,uint8_t **bufp,long *lenp,long *allocsizep)
|
|||||||
long filesize,buflen = *allocsizep;
|
long filesize,buflen = *allocsizep;
|
||||||
uint8_t *buf = *bufp;
|
uint8_t *buf = *bufp;
|
||||||
*lenp = 0;
|
*lenp = 0;
|
||||||
if ( (fp= fopen(compatible_path(fname),"rb")) != 0 )
|
if ( (fp= fopen(portable_path(fname),"rb")) != 0 )
|
||||||
{
|
{
|
||||||
fseek(fp,0,SEEK_END);
|
fseek(fp,0,SEEK_END);
|
||||||
filesize = ftell(fp);
|
filesize = ftell(fp);
|
||||||
|
|||||||
Reference in New Issue
Block a user