From 4132e9301d039d35e8aad6767fbdd056c4ec6214 Mon Sep 17 00:00:00 2001 From: DongwenHuang Date: Fri, 12 Jun 2015 12:44:42 +0800 Subject: [PATCH] Update test.c --- test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.c b/test.c index b308a92..ce07376 100644 --- a/test.c +++ b/test.c @@ -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); }