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)
2325
2325
2326
2326
2327
2327
long t0 = 0 ;
2328
- if (truncation )
2328
+ if (truncation ) {
2329
2329
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
+
2330
2335
2331
2336
if (mio_setpos (TagFile .mio , p ) == -1 )
2332
2337
error (FATAL |PERROR ,
@@ -2335,6 +2340,10 @@ extern void setTagFilePosition (MIOPos *p, bool truncation)
2335
2340
if (truncation )
2336
2341
{
2337
2342
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
+
2338
2347
if (!mio_try_resize (TagFile .mio , (size_t )t1 ))
2339
2348
error (FATAL |PERROR ,
2340
2349
"failed to truncate the tag file %ld -> %ld\n" , t0 , t1 );
You can’t perform that action at this time.
0 commit comments