Skip to content

Commit 3f8280c

Browse files
sirus20x6pd3
authored andcommitted
Fix wrong array used for float missing-value in split_format_numeric
The BCF_HT_REAL case in split_format_numeric called bcf_float_set_missing(src_vals[idst]) instead of bcf_float_set_missing(dst_vals[idst]), writing the missing sentinel into the source buffer rather than the destination. The int32 case on the preceding line correctly uses dst_vals[idst].
1 parent 9be8367 commit 3f8280c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vcfnorm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ static void split_format_numeric(args_t *args, bcf1_t *src, bcf_fmt_t *fmt, int
11351135
switch (bcf_hdr_id2type(args->hdr,BCF_HL_FMT,fmt->id))
11361136
{
11371137
case BCF_HT_INT: BRANCH_NUMERIC(int32, int32_t, src_vals[isrc]==bcf_int32_vector_end, src_vals[isrc]==bcf_int32_missing, dst_vals[idst]=bcf_int32_vector_end, dst_vals[idst]=bcf_int32_missing); break;
1138-
case BCF_HT_REAL: BRANCH_NUMERIC(float, float, bcf_float_is_vector_end(src_vals[isrc]), bcf_float_is_missing(src_vals[isrc]), bcf_float_set_vector_end(dst_vals[idst]), bcf_float_set_missing(src_vals[idst])); break;
1138+
case BCF_HT_REAL: BRANCH_NUMERIC(float, float, bcf_float_is_vector_end(src_vals[isrc]), bcf_float_is_missing(src_vals[isrc]), bcf_float_set_vector_end(dst_vals[idst]), bcf_float_set_missing(dst_vals[idst])); break;
11391139
}
11401140
#undef BRANCH_NUMERIC
11411141
}

0 commit comments

Comments
 (0)