summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-01-26 12:58:54 -0800
committerKevin McCarthy <kevin@8t8.us>2021-01-27 13:54:38 -0800
commit5d73e4cf196abcfe2ef2a39ce2233ac080156cdb (patch)
tree74f8a8bec78f73efd66c6b4b041e5f0569ca63b7 /main.c
parent7737b353357f6d8d6a86d5822d4afb98c4e444ef (diff)
Convert all mutt_atoX functions to behave strictly.
* Remove the automatic conversion of NULL and '\0' to 0. Add a flag for the cases that require lax evaluation. * Make trailing characters generate an error by default for the mutt_atouX functions. Add a flag for that case. Most of the IMAP code parses numbers out of a stream, so add the flag to those calls. * The mutt_atouX functions were also behaving incorrectly with invalid input, e.g. "ABC", returning and setting 0. Fix them to return an error in those cases. * Add a mutt_atoll() function, to be used in the next commit. * Change converters to store 0 on error. atos, atoi, and atoui were already doing this, but the others were not.
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index d813e885..7729150f 100644
--- a/main.c
+++ b/main.c
@@ -743,7 +743,7 @@ int main (int argc, char **argv, char **environ)
case 'd':
#ifdef DEBUG
- mutt_atoi (optarg, &debuglevel);
+ mutt_atoi (optarg, &debuglevel, 0);
printf (_("Debugging at level %d.\n"), debuglevel);
#else
printf ("%s", _("DEBUG was not defined during compilation. Ignored.\n"));