From: Sebastian B. <sb...@us...> - 2014-01-19 18:47:05
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24372/tests Modified Files: index_unittest.c Log Message: Now longer reads more than 200000 bytes. Index: index_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/index_unittest.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- index_unittest.c 19 Jan 2014 18:46:18 -0000 1.12 +++ index_unittest.c 19 Jan 2014 18:47:03 -0000 1.13 @@ -130,7 +130,8 @@ /** - * Read the content of the file given by the filename. + * Read the content of the file given by the filename but not + * more than 200000 bytes. * * @param filename the name of the file which should be read. * @@ -153,6 +154,9 @@ goto out; fseek(fh,0,SEEK_SET); + if (size > 200000) + size = 200000; + if (!(contents = malloc(size+1))) goto out; if ((fread(contents, 1, size, fh) != size)) |