]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/strutils: fix floating point exception
authorKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2020 10:28:59 +0000 (12:28 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2020 10:28:59 +0000 (12:28 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/1017
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/strutils.c

index e1629fb56dc6e819c4ef71896fff9c5c0c8256ef..609ef08600fd8b6c4e687655432d491b5bc6f681 100644 (file)
@@ -195,7 +195,7 @@ check_suffix:
                        frac /= 10;     /* remove last digit from frac */
                        frac_poz *= 10;
 
-                       if (seg)
+                       if (seg && seg_div / seg)
                                x += frac_base / (seg_div / seg);
                } while (frac);
        }