ram: Check for theoretical division by zero
This commit is contained in:
		@@ -36,6 +36,10 @@
 | 
				
			|||||||
			return NULL;
 | 
								return NULL;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (total == 0) {
 | 
				
			||||||
 | 
								return NULL;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return bprintf("%d", 100 * ((total - free) -
 | 
							return bprintf("%d", 100 * ((total - free) -
 | 
				
			||||||
		                            (buffers + cached)) / total);
 | 
							                            (buffers + cached)) / total);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user