summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2024-04-02 09:56:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2024-04-02 09:56:59 +0000
commit86a7691f6a9c5f952c70b8e4e218e65776f61695 (patch)
tree72c53e1e111996ecefcb07868ea465c8fa90ccb4
parent386011b9a6db2fa47bec6f48187014f90d53a61d (diff)
can shortcut by returning strtonum() value directly; ok djm
-rw-r--r--usr.bin/ssh/misc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.bin/ssh/misc.c b/usr.bin/ssh/misc.c
index 1692a05292c..67e33d5e299 100644
--- a/usr.bin/ssh/misc.c
+++ b/usr.bin/ssh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.191 2024/04/02 09:52:14 deraadt Exp $ */
+/* $OpenBSD: misc.c,v 1.192 2024/04/02 09:56:58 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
@@ -2321,13 +2321,10 @@ const char *
atoi_err(const char *nptr, int *val)
{
const char *errstr = NULL;
- long long num;
if (nptr == NULL || *nptr == '\0')
return "missing";
- num = strtonum(nptr, 0, INT_MAX, &errstr);
- if (errstr == NULL)
- *val = (int)num;
+ *val = strtonum(nptr, 0, INT_MAX, &errstr);
return errstr;
}