diff --git a/smem b/smem index 2d9a9c0..0cbd925 100755 --- a/smem +++ b/smem @@ -222,6 +222,8 @@ def showamount(a, total): if options.abbreviate: return units(a * 1024) elif options.percent: + if total == 0: + return 'N/A' return "%.2f%%" % (100.0 * a / total) return a