swap_perc: check for division by zero on obsd too
This commit is contained in:
		@@ -188,6 +188,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		getstats(&total, &used);
 | 
							getstats(&total, &used);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (total == 0) {
 | 
				
			||||||
 | 
								return NULL;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return bprintf("%d%%", 100 * used / total);
 | 
							return bprintf("%d%%", 100 * used / total);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user