changeset 94618:033cc6f89687

(Fw32_battery_status): Fix computation of %t (h:min) format.
author Juanma Barranquero <lekktu@gmail.com>
date Sun, 04 May 2008 23:19:23 +0000
parents d304e69844c2
children cc6aa752e662
files src/w32fns.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32fns.c	Sun May 04 23:12:26 2008 +0000
+++ b/src/w32fns.c	Sun May 04 23:19:23 2008 +0000
@@ -8766,14 +8766,14 @@
 	  seconds = build_string (buffer);
 
 	  m = seconds_left / 60;
-	  _snprintf (buffer, 16, "%d", m);
+	  _snprintf (buffer, 16, "%ld", m);
 	  minutes = build_string (buffer);
 
 	  h = seconds_left / 3600.0;
 	  _snprintf (buffer, 16, "%3.1f", h);
 	  hours = build_string (buffer);
 
-	  _snprintf (buffer, 16, "%1.0f:%d", h, m);
+	  _snprintf (buffer, 16, "%ld:%02ld", m / 60, m % 60);
 	  remain = build_string (buffer);
 	}
       sequences[0] = Fcons (make_number ('L'), line_status);