Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue where util_sscanf_int("") parsed as 0 #991

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

eivindjahren
Copy link
Collaborator

@eivindjahren eivindjahren commented Aug 7, 2024

Issue
Resolves #959

the function is used in

  • rd_get_start_date
  • rd_get_num_parallel_cpu__
  • string_util_sscanf_alloc_active_list
  • rd_version_is_devel_version

Neither of which where interpreting "" as 0 is appropriate.

It is also used in stringlist_iget_as_int, but that function is getting removed as it is not used anywhere.

Copy link
Contributor

@andreas-el andreas-el left a comment

Choose a reason for hiding this comment

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

Nice one!
We could have tested for multiple spaces and such, but that might be too far.

@eivindjahren eivindjahren merged commit 9540b18 into equinor:main Aug 7, 2024
19 checks passed
@eivindjahren eivindjahren deleted the issue_959 branch August 7, 2024 08:20
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.

util_sscanf_int treats empty string as 0 without errors
2 participants