[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] [grolbp]: Remove bogus (and redundant) check
|
From: |
Alejandro Colomar |
|
Subject: |
[PATCH 4/4] [grolbp]: Remove bogus (and redundant) check |
|
Date: |
Mon, 15 Jan 2024 00:51:04 +0100 |
`str == end` can only happen if strtol(3) returns 0.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
src/devices/grolbp/lbp.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index 9b061f9ad..765bf6893 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -695,7 +695,7 @@ int main(int argc, char **argv)
{
char *ptr;
long n = strtol(optarg, &ptr, 10);
- if ((n <= 0) && (ptr == optarg))
+ if (ptr == optarg)
error("argument for -c must be a positive integer");
else if (n <= 0 || n > 32767)
error("out of range argument for -c");
--
2.43.0
signature.asc
Description: PGP signature