Skip to content

Conversation

@pd3
Copy link
Member

@pd3 pd3 commented May 8, 2025

pd3 added a commit to samtools/bcftools that referenced this pull request May 8, 2025
vcf.c Outdated
Comment on lines 4709 to 4710
res = bcf_hdr_set_version(dst,src->hrec[i]->value);
need_sync += res;
Copy link
Contributor

@jkbonfield jkbonfield May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bcf_hdr_set_version returns 0 on success and <0 on error (eg strdup allocation failure). So it's inappropriate to do need_sync += res as at best it'll do nothing at all, or on error it may even remove the need to syncronise.

We should change that to need_sync = 1, and add an error check obviously.

@jkbonfield jkbonfield force-pushed the bt-2395-hdr-version branch from d8bca8a to 8c66cb7 Compare May 19, 2025 11:12
@jkbonfield jkbonfield merged commit a5e2071 into samtools:develop May 19, 2025
9 checks passed
jkbonfield pushed a commit to samtools/bcftools that referenced this pull request May 19, 2025
jkbonfield pushed a commit to samtools/bcftools that referenced this pull request May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants