From: ewt Date: Tue, 30 Apr 1996 18:43:23 +0000 (+0000) Subject: don't let sets with a total of 0 break things X-Git-Tag: 0-1~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e528434e7976a130b633dacefd4f4e3abe5622fb;p=thirdparty%2Fnewt.git don't let sets with a total of 0 break things --- diff --git a/scrollbar.c b/scrollbar.c index 212b541..18e3bf8 100644 --- a/scrollbar.c +++ b/scrollbar.c @@ -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;