From: Sebastian B. <sb...@us...> - 2014-01-19 18:32:52
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22601 Modified Files: index_external.c Log Message: Seek at the end of the file before determing the offset of the new string. The offset would be wrong otherwise as we seek in the same file when reading the strings. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- index_external.c 19 Jan 2014 18:32:01 -0000 1.13 +++ index_external.c 19 Jan 2014 18:32:50 -0000 1.14 @@ -475,6 +475,8 @@ idx = (struct index_external*)index; /* Determine position and write text */ + if (fseek(idx->string_file, 0, SEEK_END) != 0) + return 0; long offset = ftell(idx->string_file); fputs(text, idx->string_file); |