@@ -2415,7 +2415,7 @@ static void init_columns(args_t *args)
2415
2415
col -> hdr_key_dst = strdup (str .s + 5 );
2416
2416
tmp .l = 0 ;
2417
2417
ksprintf (& tmp ,"##INFO=<ID=%s,Number=.,Type=String,Description=\"Transferred FILTER column\">" ,col -> hdr_key_dst );
2418
- bcf_hdr_append (args -> hdr_out , tmp .s );
2418
+ if ( bcf_hdr_append (args -> hdr_out , tmp .s ) ) error ( "[%s:%d] failed to update the header\n" , __FILE__ , __LINE__ );
2419
2419
if (bcf_hdr_sync (args -> hdr_out ) < 0 ) error_errno ("[%s] Failed to update header" , __func__ );
2420
2420
int hdr_id = bcf_hdr_id2int (args -> hdr_out , BCF_DT_ID , col -> hdr_key_dst );
2421
2421
col -> number = bcf_hdr_id2length (args -> hdr_out ,BCF_HL_INFO ,hdr_id );
@@ -2447,7 +2447,7 @@ static void init_columns(args_t *args)
2447
2447
if ( k < 0 ) error ("[%s] Failed to parse the header, the ID attribute not found" , __func__ );
2448
2448
tmp .l = 0 ;
2449
2449
bcf_hrec_format (hrec , & tmp );
2450
- bcf_hdr_append (args -> hdr_out , tmp .s );
2450
+ if ( bcf_hdr_append (args -> hdr_out , tmp .s ) ) error ( "[%s:%d] failed to update the header\n" , __FILE__ , __LINE__ );
2451
2451
}
2452
2452
if (bcf_hdr_sync (args -> hdr_out ) < 0 )
2453
2453
error_errno ("[%s] Failed to update header" , __func__ );
@@ -2481,7 +2481,7 @@ static void init_columns(args_t *args)
2481
2481
if ( skip_info && khash_str2int_has_key (skip_info ,hrec -> vals [k ]) ) continue ;
2482
2482
tmp .l = 0 ;
2483
2483
bcf_hrec_format (hrec , & tmp );
2484
- bcf_hdr_append (args -> hdr_out , tmp .s );
2484
+ if ( bcf_hdr_append (args -> hdr_out , tmp .s ) ) error ( "[%s:%d] failed to update the header\n" , __FILE__ , __LINE__ );
2485
2485
if (bcf_hdr_sync (args -> hdr_out ) < 0 )
2486
2486
error_errno ("[%s] Failed to update header" , __func__ );
2487
2487
int hdr_id = bcf_hdr_id2int (args -> hdr_out , BCF_DT_ID , hrec -> vals [k ]);
@@ -2517,7 +2517,7 @@ static void init_columns(args_t *args)
2517
2517
if ( skip_fmt && khash_str2int_has_key (skip_fmt ,hrec -> vals [k ]) ) continue ;
2518
2518
tmp .l = 0 ;
2519
2519
bcf_hrec_format (hrec , & tmp );
2520
- bcf_hdr_append (args -> hdr_out , tmp .s );
2520
+ if ( bcf_hdr_append (args -> hdr_out , tmp .s ) ) error ( "[%s:%d] failed to update the header\n" , __FILE__ , __LINE__ );
2521
2521
if (bcf_hdr_sync (args -> hdr_out ) < 0 )
2522
2522
error_errno ("[%s] Failed to update header" , __func__ );
2523
2523
int hdr_id = bcf_hdr_id2int (args -> hdr_out , BCF_DT_ID , hrec -> vals [k ]);
@@ -2565,7 +2565,7 @@ static void init_columns(args_t *args)
2565
2565
if ( !hrec ) error ("No such annotation \"%s\" in %s\n" , key_src ,args -> targets_fname );
2566
2566
tmp .l = 0 ;
2567
2567
bcf_hrec_format_rename (hrec , key_dst , & tmp );
2568
- bcf_hdr_append (args -> hdr_out , tmp .s );
2568
+ if ( bcf_hdr_append (args -> hdr_out , tmp .s ) ) error ( "[%s:%d] failed to update the header\n" , __FILE__ , __LINE__ );
2569
2569
if (bcf_hdr_sync (args -> hdr_out ) < 0 )
2570
2570
error_errno ("[%s] Failed to update header" , __func__ );
2571
2571
}
@@ -2698,7 +2698,7 @@ static void init_columns(args_t *args)
2698
2698
tmp .l = 0 ;
2699
2699
bcf_hrec_format_rename (hrec , key_dst , & tmp );
2700
2700
}
2701
- bcf_hdr_append (args -> hdr_out , tmp .s );
2701
+ if ( bcf_hdr_append (args -> hdr_out , tmp .s ) ) error ( "[%s:%d] failed to update the header\n" , __FILE__ , __LINE__ );
2702
2702
if (bcf_hdr_sync (args -> hdr_out ) < 0 )
2703
2703
error_errno ("[%s] Failed to update header" , __func__ );
2704
2704
hdr_id = bcf_hdr_id2int (args -> hdr_out , BCF_DT_ID , key_dst );
0 commit comments