[hackers] [sbase] Check parseoffset return value in od(1) || FRIGN

From: <git_AT_suckless.org>
Date: Wed, 30 Sep 2015 20:44:18 +0200 (CEST)

commit 81634512496b3188aaf77c71506ed248af132066
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Wed Sep 30 19:13:32 2015 +0200
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Sep 30 19:44:10 2015 +0100

    Check parseoffset return value in od(1)
    
    Yeah, kinda embarassing. Forgot about that.

diff --git a/od.c b/od.c
index 30031c7..f4315ba 100644
--- a/od.c
+++ b/od.c
_AT_@ -118,10 +118,12 @@ main(int argc, char *argv[])
                 radix = s[0];
                 break;
         case 'j':
- skip = parseoffset(EARGF(usage()));
+ if ((skip = parseoffset(EARGF(usage()))) < 0)
+ return 1;
                 break;
         case 'N':
- maxbytes = parseoffset(EARGF(usage()));
+ if ((maxbytes = parseoffset(EARGF(usage()))) < 0)
+ return 1;
                 break;
         case 't':
                 s = EARGF(usage());
Received on Wed Sep 30 2015 - 20:44:18 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 30 2015 - 20:48:36 CEST