]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
don't let sets with a total of 0 break things
authorewt <ewt>
Tue, 30 Apr 1996 18:43:23 +0000 (18:43 +0000)
committerewt <ewt>
Tue, 30 Apr 1996 18:43:23 +0000 (18:43 +0000)
scrollbar.c

index 212b54158172c099742aab1c2f91cef504c9d971..18e3bf8ec53f53a487aa262ba3fa7725baf4738a 100644 (file)
@@ -24,7 +24,7 @@ void newtScrollbarSet(newtComponent co, int where, int total) {
     struct scrollbar * sb = co->data;
     int new;
 
-    new = (where * (co->height - 1)) / total;
+    new = (where * (co->height - 1)) / (total ? total : 1);
     if (new != sb->curr) {
        sbDrawThumb(co, 0);
        sb->curr = new;