[hackers] [sbase] du: fix possible division by zero if $BLOCKSIZE is 0 || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Wed, 1 Apr 2015 12:11:10 +0200 (CEST)

commit d583d12300a8990715824857400aaa7f66699333
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon Mar 30 19:58:06 2015 +0200

    du: fix possible division by zero if $BLOCKSIZE is 0
    
    these kind of $BLOCKSIZE dont make sense, but dont crash atleast.

diff --git a/du.c b/du.c
index b20201a..0bc732b 100644
--- a/du.c
+++ b/du.c
_AT_@ -94,7 +94,7 @@ main(int argc, char *argv[])
 
         bsize = getenv("BLOCKSIZE");
         if (bsize)
- blksize = estrtonum(bsize, 0, MIN(LLONG_MAX, SIZE_MAX));
+ blksize = estrtonum(bsize, 1, MIN(LLONG_MAX, SIZE_MAX));
         if (kflag)
                 blksize = 1024;
 
Received on Wed Apr 01 2015 - 12:11:10 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 01 2015 - 12:12:15 CEST