Changeset 1283


Ignore:
Timestamp:
Mar 31, 2007, 12:21:06 AM (12 years ago)
Author:
bruno
Message:

Avoids divide by zero (idea of M. Loiseleur mloiseleur_at_linagora.com)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1264 r1283  
    291291                    return (0);
    292292                }
    293                 update_evalcall_form((int) (lino * 100 / noof_lines));
     293                if (noof_lines != 0) {
     294                    update_evalcall_form((int) (lino * 100 / noof_lines));
     295                }
    294296            }
    295297        }
     
    366368
    367369    if (filelist->ch == '\0') {
    368         if (!(i++ % 1111)) {
     370        if (!(i++ % 1111) && (g_original_noof_lines_in_filelist != 0)) {
    369371            percentage =
    370372                (int) (i * 100 / g_original_noof_lines_in_filelist);
     
    879881        }
    880882        add_string_at_node(filelist, fname);
    881         if (!(++lino % 1111)) {
     883        if (!(++lino % 1111) && (lines_in_filelist != 0)) {
    882884            percentage = (int) (lino * 100 / lines_in_filelist);
    883885            update_evalcall_form(percentage);
     
    987989            fprintf(fout, "%s\n", str);
    988990//      }
    989             if (!(++lino % 1111)) {
     991            if (!(++lino % 1111) && (lines_in_filelist != 0)) {
    990992                percentage = (int) (lino * 100 / lines_in_filelist);
    991993                update_evalcall_form(percentage);
     
    13591361                "grep -Fv \"%s\" %s > %s.new 2> /dev/null", dir,
    13601362                g_skeleton_filelist, g_skeleton_filelist);
    1361         if (!system(find_skeleton_marker)) {
     1363        if (!system(find_skeleton_marker) && (g_skeleton_entries != 0)) {
    13621364            percentage = (int) (skeleton_lino * 100 / g_skeleton_entries);
    13631365            skeleton_lino++;
Note: See TracChangeset for help on using the changeset viewer.