File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2325,8 +2325,13 @@ extern void setTagFilePosition (MIOPos *p, bool truncation)
23252325
23262326
23272327 long t0 = 0 ;
2328- if (truncation )
2328+ if (truncation ) {
23292329 t0 = mio_tell (TagFile .mio );
2330+ if (t0 == -1 )
2331+ error (FATAL |PERROR ,
2332+ "failed to tell the file position of the tag file (t0)\n" );
2333+ }
2334+
23302335
23312336 if (mio_setpos (TagFile .mio , p ) == -1 )
23322337 error (FATAL |PERROR ,
@@ -2335,6 +2340,10 @@ extern void setTagFilePosition (MIOPos *p, bool truncation)
23352340 if (truncation )
23362341 {
23372342 long t1 = mio_tell (TagFile .mio );
2343+ if (t1 == -1 )
2344+ error (FATAL |PERROR ,
2345+ "failed to tell the file position of the tag file (t0)\n" );
2346+
23382347 if (!mio_try_resize (TagFile .mio , (size_t )t1 ))
23392348 error (FATAL |PERROR ,
23402349 "failed to truncate the tag file %ld -> %ld\n" , t0 , t1 );
You can’t perform that action at this time.
0 commit comments