Styken's fix for bug # 1035
authorKent Mein <mein@cs.umn.edu>
Tue, 2 Mar 2004 16:49:50 +0000 (16:49 +0000)
committerKent Mein <mein@cs.umn.edu>
Tue, 2 Mar 2004 16:49:50 +0000 (16:49 +0000)
Its a if to check for divide by 0 case.

Kent

source/blender/src/filesel.c

index 78f7f58faaffe0240bf87731ab258da9018874e8..751fed5d435fa04617995e64feec44b704107c4e 100644 (file)
@@ -1011,7 +1011,8 @@ static int calc_filesel_regel(SpaceFile *sfile, int nr, int *valx, int *valy)
 
        /* amount of lines */
        val= (textrct.ymax-textrct.ymin)/FILESEL_DY;
-       coll= nr/val;
+       if (val == 0) coll = 0;
+        else coll= nr/val;
        nr -= coll*val;
        
        *valy= textrct.ymax-FILESEL_DY+3 - nr*FILESEL_DY;