summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorRocco Rutte <pdmef@gmx.net>2009-06-01 11:26:37 +0200
committerRocco Rutte <pdmef@gmx.net>2009-06-01 11:26:37 +0200
commit547b25a21660416bfb3ff49e173a9eb469fff779 (patch)
tree57189703c13f2c8ce953ef23eac697dbfcd10c68 /main.c
parent7444e911d87a59834b9e36e3668cc1dfd9905f2b (diff)
Use strtol() wrappers for most atoi() calls
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index d4023ed3..baea582e 100644
--- a/main.c
+++ b/main.c
@@ -631,7 +631,11 @@ int main (int argc, char **argv)
case 'd':
#ifdef DEBUG
- debuglevel = atoi (optarg);
+ if (mutt_atoi (optarg, &debuglevel) < 0 || debuglevel <= 0)
+ {
+ fprintf (stderr, _("Error: value '%s' is invalid for -d.\n"), optarg);
+ return 1;
+ }
printf (_("Debugging at level %d.\n"), debuglevel);
#else
printf _("DEBUG was not defined during compilation. Ignored.\n");