Skip to content

strparse: switch to curl_off_t as base data type#16336

Closed
bagder wants to merge 2 commits intomasterfrom
bagder/more-number-parsing
Closed

strparse: switch to curl_off_t as base data type#16336
bagder wants to merge 2 commits intomasterfrom
bagder/more-number-parsing

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented Feb 14, 2025

  • add hex and octal parsers to the Curl_str_* family
  • make curlx_strtoofft use these parsers
  • remove all use of strtol() and strtoul() in library code
  • generally use Curl_str_* more than strtoofft, for stricter parsing
  • supports 64-bit universally, instead of 'long' which differs in size between platforms

Extended the unit test 1664 to verify hex and octal parsing.

@bagder bagder force-pushed the bagder/more-number-parsing branch 2 times, most recently from 845b324 to a9911e7 Compare February 14, 2025 17:18
- add hex and octal parsers to the Curl_str_* family
- make curlx_strtoofft use these parsers
- remove all use of strtol() and strtoul() in library code
- generally use Curl_str_* more than strtoofft, for stricter parsing
- supports 64-bit universally, instead of 'long' which differs in size
  between platforms

Extended the unit test 1664 to verify hex and octal parsing.

Closes #16336
@bagder bagder marked this pull request as ready for review February 14, 2025 21:47
@bagder bagder force-pushed the bagder/more-number-parsing branch from a9911e7 to 604eae8 Compare February 14, 2025 22:16
@bagder bagder closed this in b4538ec Feb 15, 2025
@bagder bagder deleted the bagder/more-number-parsing branch February 15, 2025 20:59
vszakats added a commit to vszakats/curl that referenced this pull request Feb 20, 2025
vszakats added a commit to vszakats/curl that referenced this pull request Feb 21, 2025
vszakats added a commit to vszakats/curl that referenced this pull request Feb 21, 2025
vszakats added a commit to vszakats/curl that referenced this pull request Feb 21, 2025
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
- add hex and octal parsers to the Curl_str_* family
- make curlx_strtoofft use these parsers
- remove all use of strtol() and strtoul() in library code
- generally use Curl_str_* more than strtoofft, for stricter parsing
- supports 64-bit universally, instead of 'long' which differs in size
  between platforms

Extended the unit test 1664 to verify hex and octal parsing.

Closes curl#16336
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant