curl_formdata: fix to pass long where missing, document CURLFORM_NAMELENGTH#22017
Closed
vszakats wants to merge 5 commits into
Closed
curl_formdata: fix to pass long where missing, document CURLFORM_NAMELENGTH#22017vszakats wants to merge 5 commits into
CURLFORM_NAMELENGTH#22017vszakats wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens correctness and consistency around the deprecated curl_formadd() form API by ensuring options that expect long are documented/passed as long, and by cleaning up a few documentation/examples.
Changes:
- Update docs/examples to explicitly pass
longtoCURLFORM_BUFFERLENGTHand documentCURLFORM_NAMELENGTH. - Fix
tests/libtest/lib650.cto pass alongforCURLFORM_NAMELENGTH(and simplify an interim variable). - Minor whitespace/style cleanups in docs and comments.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/libtest/lib650.c |
Fixes CURLFORM_NAMELENGTH argument type to long in the test and simplifies length handling. |
lib/formdata.c |
Adjusts an internal comment example to use 10L and cleans whitespace. |
docs/libcurl/opts/CURLOPT_COPYPOSTFIELDS.md |
Formatting/whitespace tweak in an example. |
docs/libcurl/curl_formadd.md |
Adds CURLFORM_NAMELENGTH section and fixes CURLFORM_BUFFERLENGTH example to cast to long. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment was marked as outdated.
This comment was marked as outdated.
94be47b to
504be0a
Compare
504be0a to
36ea740
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib650: pass
longtoCURLFORM_NAMELENGTHin test.Spotted by Copilot.
libtests: prefer
sizeof()overstrlen(), fix potential OOB read in 1591 #22011 (comment)Follow-up to 3620e56
lib650: drop an interim variable, and interim casts.
Follow-up to 60776a0 Enable and fix more GCC warnings #2747
curl_formdata.md: document
CURLFORM_NAMELENGTHon man page.curl_formdata.md: pass
longtoCURLFORM_BUFFERLENGTHon man page.formdata: pass
longtoCURLFORM_CONTENTSLENGTHin comment.https://github.com/curl/curl/pull/22017/files?w=1
There is also this in lib650, I couldn't trace back in source
if
size_tis correct or should belong(I'd guess it's thelatter):