From 4cd8531d6b0614d8081dc41c58592c2046b0e366 Mon Sep 17 00:00:00 2001
From: Miles Bader <miles@gnu.org>
Date: Wed, 15 May 1996 02:22:34 +0000
Subject: (add_field): Correctly decrement *SECS by amount printed.

---
 libshouldbeinlibc/timefmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'libshouldbeinlibc/timefmt.c')

diff --git a/libshouldbeinlibc/timefmt.c b/libshouldbeinlibc/timefmt.c
index 1ae48922..add5001f 100644
--- a/libshouldbeinlibc/timefmt.c
+++ b/libshouldbeinlibc/timefmt.c
@@ -176,7 +176,7 @@ add_field (int *secs, int unit, int *leading_zeros,
   int units = *secs / unit;
   if (units || (width >= min_width && *leading_zeros))
     {
-      *secs -= units;
+      *secs -= units * unit;
       *leading_zeros = 1;
       return
 	sprintf (buf,
-- 
cgit v1.2.3