From 455466fb67bdce37ee8ce6dd12184584115db546 Mon Sep 17 00:00:00 2001 From: Hynek Cernoch Date: Mon, 13 Dec 2010 22:33:05 +0100 Subject: [PATCH] Fixed bug in realmem option --- smem | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smem b/smem index 9e751f1..da7f5fc 100755 --- a/smem +++ b/smem @@ -178,7 +178,9 @@ def fromunits(x): M=2**20, MB=2**20, G=2**30, GB=2**30) for k,v in s.items(): if x.endswith(k): - return int(float(x[:len(k)])*v) + return int(float(x[:-len(k)])*v) + sys.stderr.write("Memory size should be written with units, for example 1024M\n") + sys.exit(-1) def pidusername(pid): return src.username(src.piduser(pid))