--- projects/libstatgrab/src/saidar/saidar.c 2003/10/20 22:35:14 1.11 +++ projects/libstatgrab/src/saidar/saidar.c 2003/10/22 13:07:22 1.13 @@ -295,12 +295,17 @@ void display_data(){ printw("%8s", size_conv(stats.swap_stats->free)); } - if (stats.mem_stats != NULL && stats.swap_stats != NULL) { - /* VM */ + /* VM */ + if (stats.mem_stats != NULL && stats.mem_stats->total != 0) { move(6, 54); printw("%5.2f%%", (100.00 * (float)(stats.mem_stats->used)/stats.mem_stats->total)); + } + if (stats.swap_stats != NULL && stats.swap_stats->total != 0) { move(7, 54); printw("%5.2f%%", (100.00 * (float)(stats.swap_stats->used)/stats.swap_stats->total)); + } + if (stats.mem_stats != NULL && stats.swap_stats != NULL && + stats.mem_stats->total != 0 && stats.swap_stats->total != 0) { move(8, 54); printw("%5.2f%%", (100.00 * (float)(stats.mem_stats->used+stats.swap_stats->used)/(stats.mem_stats->total+stats.swap_stats->total))); }