summaryrefslogtreecommitdiff
path: root/wsutil/clopts_common.c
AgeCommit message (Collapse)AuthorFilesLines
2016-09-12Let strtoi with NULL endptr require no invalid charactersPeter Wu1-6/+4
If the caller is not interested in checking its end, then it probably wants a valid number only if the string contains a valid number. Add a shortcut for this. Change-Id: I39701bd445e29fb2606720b18ca3764c74a7255b Reviewed-on: https://code.wireshark.org/review/17658 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-09-08Add get_ routines to get a guint32, and use them.Guy Harris1-1/+33
By analogy to get_natural_int() and get_positive_int(), add routines to get a guint32 and to get a non-zero guint32, doing all the necessary error checks, and use it. Change-Id: I65a9ac8a3d136886df3588806ae7af5bdc7b8cb6 Reviewed-on: https://code.wireshark.org/review/17586 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-07Make the ws_strto* routines more like the strto* routines.Guy Harris1-2/+3
Not all uses of atoi() or various strto* routines in Wireshark expect the string to contain *only* a number, so not all uses should require that the byte after the number be a '\0'. Have the ws_strto* routines take a "pointer a pointer set to point to the character after the number" argument, and have the callers do the appropriate checks of the character after that. This fixes the VMS trace reading code so that it can read those files again. The get_ routines are handed command-line arguments, so they *do* expect the string to contain only a number; have them check to make sure the byte after the number is a '\0'. Change-Id: I46fc1bea7912b9278e385fe38491a0a2ad60d697 Reviewed-on: https://code.wireshark.org/review/17560 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-06Use ws_strtoi32() in get_natural_int().Guy Harris1-10/+14
Change-Id: I9a95239de8db18cff0f6c62cb526f3ef0cb29f01 Reviewed-on: https://code.wireshark.org/review/17513 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-28Deleting unnecessary #includes from wsutil.Martin Mathieson1-2/+0
Will look at cleaning up and committing script afterwards. Change-Id: Id785e581740ab62fe9258ecfcb0926761ad9c527 Reviewed-on: https://code.wireshark.org/review/6086 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-10-14Add editor-modelines; adjust whitespace.Bill Meier1-1/+14
Change-Id: I8cad872cee972a6d22a72852dac57fd188daca84 Reviewed-on: https://code.wireshark.org/review/4683 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-29Move some more stuff into wsutil.Guy Harris1-0/+70
Move the routines to parse numerical command-line arguments there. Make cmdarg_err() and cmdarg_err_cont() routines in wsutil that just call routines specified by a call to cmdarg_err_init(), and have programs supply the appropriate routines to it. Change-Id: Ic24fc758c0e647f4ff49eb91673529bcb9587b01 Reviewed-on: https://code.wireshark.org/review/2704 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>