`str == end` can only happen if strtol(3) returns 0.

Closes: <https://savannah.gnu.org/bugs/?65451>
Cc: "G. Branden Robinson" <bran...@debian.org>
Cc: Dave Kemper <saint.s...@gmail.com>
Cc: "James K. Lowden" <jklow...@schemamania.org>
Cc: Colin Watson <cjwat...@debian.org>
Cc: Werner LEMBERG <w...@gnu.org>
Signed-off-by: Alejandro Colomar <a...@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 63077f16e..c05b42ec3 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -696,7 +696,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

Attachment: signature.asc
Description: PGP signature

Reply via email to