verse.plugins.uptime: Explicitly cast uptime to a number

Wed, 04 Sep 2013 13:40:55 +0200

author
Kim Alvefur <zash@zash.se>
date
Wed, 04 Sep 2013 13:40:55 +0200
changeset 351
4455b07f77ed
parent 348
34b878d58948
child 352
413e3f449865

verse.plugins.uptime: Explicitly cast uptime to a number

plugins/uptime.lua file | annotate | diff | comparison | revisions
--- a/plugins/uptime.lua	Sat Jul 06 08:40:18 2013 +0200
+++ b/plugins/uptime.lua	Wed Sep 04 13:40:55 2013 +0200
@@ -23,7 +23,7 @@
 			function (reply)
 				local query = reply:get_child("query", xmlns_last);
 				if reply.attr.type == "result" then
-					local seconds = query.attr.seconds;
+					local seconds = tonumber(query.attr.seconds);
 					callback({
 						seconds = seconds or nil;
 						});

mercurial