|
@@ -52,7 +52,7 @@ static void AddExample(char* name, char* path, laUiDefineFunc func){
|
|
|
char filename[512]; sprintf(filename,"example_source_files/%s.c",path);
|
|
|
FILE* f=fopen(filename,"r"); if(!f) return;
|
|
|
int s; fseek(f,0,SEEK_END); s=ftell(f); fseek(f,0,SEEK_SET); if(!s){ fclose(f); return; }
|
|
|
- char* buf=calloc(1,s); fread(buf,s,1,f); fclose(f);
|
|
|
+ char* buf=calloc(1,s+1); fread(buf,s,1,f); fclose(f);
|
|
|
strSafeSet(&ei->Code,buf);
|
|
|
free(buf);
|
|
|
}
|