summaryrefslogtreecommitdiff
path: root/src/tool_paramhlp.c
Commit message (Collapse)AuthorAgeFilesLines
* curl: make checkpasswd use dynbufDaniel Stenberg2020-09-141-15/+8
| | | | Closes #5952
* curl: make file2memory use dynbufDaniel Stenberg2020-09-141-38/+14
| | | | Closes #5952
* curl: make file2string use dynbufDaniel Stenberg2020-09-141-32/+9
| | | | Closes #5952
* file2memory: use a define instead of -1 unsigned valueDaniel Stenberg2020-07-161-2/+2
| | | | | | | | | ... to use the maximum value for 'size_t' when detecting integer overflow. Changed the limit to max/4 as already that seems unreasonably large. Codacy didn't like the previous approach. Closes #5683
* tool_paramhlp: fixup C89 mistakeDaniel Stenberg2020-05-191-2/+1
| | | | Follow-up to c5f0a9db22.
* tool_paramhlp: fixed potentially uninitialized strtol() variableSiva Sivaraman2020-05-191-0/+1
| | | | | | | Seems highly unlikely to actually be possible, but better safe than sorry. Closes #5417
* curl -w: handle a blank input file correctlyDaniel Stenberg2020-01-061-2/+2
| | | | | | | | | | Previously it would end up with an uninitialized memory buffer that would lead to a crash or junk getting output. Added test 1271 to verify. Reported-by: Brian Carpenter Closes #4786
* tool: make a few char pointers point to const char insteadMarcel Raad2019-12-311-1/+1
| | | | | | These are read-only. Closes https://github.com/curl/curl/pull/4771
* curl: use errorf() betterDaniel Stenberg2019-12-101-1/+1
| | | | | | | | | | Change series of error outputs to use errorf(). Only errors that are due to mistakes in command line option usage should use helpf(), other types of errors in the tool should rather use errorf(). Closes #4691
* curl:file2string: load large files much fasterGilles Vollant2019-09-131-7/+24
| | | | | | | ... by using a more efficient realloc scheme. Bug: https://curl.haxx.se/mail/lib-2019-09/0045.html Closes #4336
* curl: cap the maximum allowed values for retry time argumentsDaniel Stenberg2019-07-301-0/+22
| | | | | | | | | | ... to avoid integer overflows later when multiplying with 1000 to convert seconds to milliseconds. Added test 1269 to verify. Reported-by: Jason Lee Closes #4166
* printf: fix format specifiersRikard Falkeborn2019-01-041-4/+3
| | | | Closes #3426
* cppcheck: fix warningsMarian Klymov2018-06-111-5/+5
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* curl: make str2udouble not return values on errorDaniel Stenberg2017-09-181-3/+5
| | | | | | | | ... previously it would store a return value even when it returned error, which could make the value get used anyway! Reported-by: Brian Carpenter Closes #1893
* code style: use spaces around plusesDaniel Stenberg2017-09-111-7/+7
|
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-1/+1
|
* system.h: remove all CURL_SIZEOF_* definesDaniel Stenberg2017-08-171-1/+1
| | | | | | | ... as they're not used externally and internally we check for the sizes already in configure etc. Closes #1767
* strtoofft: reduce integer overflow risks globallyDaniel Stenberg2017-08-141-3/+7
| | | | | | | ... make sure we bail out on overflows. Reported-by: Brian Carpenter Closes #1758
* curl: do bounds check using a double comparisonAdam Sampson2017-08-091-1/+1
| | | | | | | | | | | | | The fix for this in 8661a0aacc01492e0436275ff36a21734f2541bb wasn't complete: if the parsed number in num is larger than will fit in a long, the conversion is undefined behaviour (causing test1427 to fail for me on IA32 with GCC 7.1, although it passes on AMD64 and ARMv7). Getting rid of the cast means the comparison will be done using doubles. It might make more sense for the max argument to also be a double... Fixes #1750 Closes #1749
* curl: detect and bail out early on parameter integer overflowsDaniel Stenberg2017-08-071-8/+27
| | | | | | | | | Make the number parser aware of the maximum limit curl accepts for a value and return an error immediately if larger, instead of running an integer overflow later. Fixes #1730 Closes #1736
* curl_setup_once: Remove ERRNO/SET_ERRNO macrosJay Satiro2017-07-101-2/+2
| | | | | | | | | | | | Prior to this change (SET_)ERRNO mapped to GetLastError/SetLastError for Win32 and regular errno otherwise. I reviewed the code and found no justifiable reason for conflating errno on WIN32 with GetLastError/SetLastError. All Win32 CRTs support errno, and any Win32 multithreaded CRT supports thread-local errno. Fixes https://github.com/curl/curl/issues/895 Closes https://github.com/curl/curl/pull/1589
* vtls: add options to specify range of enabled TLS versionsJozef Kralik2017-03-081-0/+33
| | | | | | | This commit introduces the CURL_SSLVERSION_MAX_* constants as well as the --tls-max option of the curl tool. Closes https://github.com/curl/curl/pull/1166
* checksrc: warn for assignments within if() expressionsDaniel Stenberg2016-12-141-5/+10
| | | | | ... they're already frowned upon in our source code style guide, this now enforces the rule harder.
* checksrc: stricter no-space-before-paren enforcementDaniel Stenberg2016-12-131-1/+1
| | | | In order to make the code style more uniform everywhere
* strcase: make the tool use curl_str[n]equal insteadDaniel Stenberg2016-10-311-10/+10
| | | | | | | | As they are after all part of the public API. Saves space and reduces complexity. Remove the strcase defines from the curlx_ family. Suggested-by: Dan Fandrich Idea: https://curl.haxx.se/mail/lib-2016-10/0136.html
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-11/+11
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* curl: whitelist use of strtok() in non-threaded contextDaniel Stenberg2016-09-071-1/+3
|
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* tool_paramhlp: Fixed display of URL index in password prompt for --nextSteve Holme2015-11-271-1/+1
| | | | | | | | Commit f3bae6ed73 added the URL index to the password prompt when using --next. Unfortunately, because the size_t specifier (%zu) is not supported by all sprintf() implementations we use the curl_off_t format specifier instead. The display of an incorrect value arises on platforms where size_t and curl_off_t are of a different size.
* oauth2: Don't use XOAUTH2 in OAuth 2.0 variablesSteve Holme2015-11-091-1/+1
|
* CURLOPT_DEFAULT_PROTOCOL: addedNathaniel Waisbrot2015-08-221-0/+21
| | | | | | | | | | | | | | | - Add new option CURLOPT_DEFAULT_PROTOCOL to allow specifying a default protocol for schemeless URLs. - Add new tool option --proto-default to expose CURLOPT_DEFAULT_PROTOCOL. In the case of schemeless URLs libcurl will behave in this way: When the option is used libcurl will use the supplied default. When the option is not used, libcurl will follow its usual plan of guessing from the hostname and falling back to 'http'.
* tool: Updated the warnf() function to use the GlobalConfig structureSteve Holme2015-02-271-5/+14
| | | | | | As the 'error' and 'mute' options are now part of the GlobalConfig, rather than per Operation, updated the warnf() function to use this structure rather than the OperationConfig.
* curl tool: Enable support for the SMB protocolBill Nagel2014-11-301-0/+2
| | | | This patch enables SMB/CIFS support in the curl command-line tool.
* tool: Moved --stderr to the global configSteve Holme2014-03-011-1/+1
|
* tool_cfgable: Renamed Configurable structure to OperationConfigSteve Holme2014-02-231-6/+6
| | | | | To allow for the addition of a global config structure and prevent confusion between the two.
* tool_paramhlp: Fixed compilation warningsSteve Holme2014-02-201-8/+8
| | | | declaration of 'index' shadows a global declaration
* tool_paramhlp: Added URL index to password prompt for multiple operationsSteve Holme2014-02-161-7/+16
|
* tool_operate: Moved required argument getting into separate functionSteve Holme2014-02-151-2/+40
|
* tool: Fixed incorrect return code if password prompting runs out of memorySteve Holme2014-01-191-6/+7
| | | | | | | | | Due to the changes in commit 3c929ff9f6ea and lack of subsequent updates, curl could return a CURLE_FTP_ACCEPT_FAILED error if checkpasswd() ran out of memory in versions 7.33.0 and 7.34.0. Updated the function declaration and return code to return CURLE_OUT_OF_MEMORY and CURLE_OK where appropriate.
* src/tool: allow timeouts to accept decimal valuesDave Reisner2013-07-141-0/+42
| | | | | | | | | | | Implement wrappers around strtod to convert the user argument to a double with sane error checking. Use this to allow --max-time and --connect-timeout to accept decimal values instead of strictly integers. The manpage is updated to make mention of this feature and, additionally, forewarn that the actual timeout of the operation can vary in its precision (particularly as the value increases in its decimal precision).
* src/tool_paramhlp: try harder to catch negativesDave Reisner2013-07-141-3/+7
| | | | | | strto* functions happily chomp off leading whitespace, so simply checking for str[0] can lead to false negatives. Do the full parse and check the out value instead.
* tool_paramhlp: Fixed options being included in usernameSteve Holme2013-04-201-4/+16
| | | | | | | Fix to prevent the options from being displayed when curl requests the user's password if the following command line is specified: --user username;options
* Revert changes relative to lib/*.[ch] recent renamingYang Tse2013-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-2/+2
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* avoid mixing of enumerated type with another typeYang Tse2012-11-261-9/+9
|
* cmdline: parse numerical options stricterDaniel Stenberg2012-07-101-11/+35
| | | | | | | | | | | 1 - str2offset() no longer accepts negative numbers since offsets are by nature positive. 2 - introduced str2unum() for the command line parser that accepts numericals which are not supposed to be negative, so that it will properly complain on apparent bad uses and mistakes. Bug: http://curl.haxx.se/mail/archive-2012-07/0013.html
* curl tool: make curl.h first header included in tool_setup.hYang Tse2012-04-081-2/+0
|
* curl tool: use configuration files from lib directoryYang Tse2012-04-061-2/+2
| | | | | | | | | | | Configuration files such as curl_config.h and all config-*.h no longer exist nor are generated/copied into 'src' directory, now these only exist in 'lib' directory from where curl tool sources uses them. Additionally old src/setup.h has been refactored into src/tool_setup.h which now pulls lib/setup.h The possibility of a makefile needing an include path adjustment exists.
* curl tool: allow negative numbers as option valuesAlessandro Ghedini2012-02-131-3/+1
| | | | | | Fix the str2num() function to not check if the input string starts with a digit, since strtol() supports numbers prepended with '-' (and '+') too. This makes the --max-redirs option work as documented.
* curl tool: reviewed code moved to tool_*.[ch] filesYang Tse2011-10-061-3/+2
|