[PATCH] Fixed 24 hour time format bugs
Jorgen Cederlof <[email protected]> Mon, 9 Feb 2009 22:45:57 -0800
| Newsgroups | gmane.comp.printing.a2ps.bugs |
|---|---|
| Message-ID | <20090210064556.GA14025@localdomain> |
Hello, 24 hour time is formatted incorrectly the first ten hours each day. If I print a page in the morning the header will say "9:23" instead of "09:23". This patch fixes the problem. Regards, Jörgen --- a2ps-4.14/lib/metaseq.c.orig 2007-12-28 17:58:20.000000000 -0800 +++ a2ps-4.14/lib/metaseq.c 2009-02-09 22:34:37.000000000 -0800 @@ -315,7 +315,7 @@ XFREE (cp); break; case 'C': /* `%C' runtime in `hh:mm:ss' format */ - sprintf ((char *)buf, "%d:%02d:%02d", job->run_tm.tm_hour, + sprintf ((char *)buf, "%02d:%02d:%02d", job->run_tm.tm_hour, job->run_tm.tm_min, job->run_tm.tm_sec); APPEND_STR (buf); break; @@ -461,13 +461,13 @@ break; case 'T': /* `%T' runtime in 24-hour format */ - sprintf ((char *)buf, "%d:%02d", + sprintf ((char *)buf, "%02d:%02d", job->run_tm.tm_hour, job->run_tm.tm_min); APPEND_STR (buf); break; case '*': /* `%*' runtime in 24-hour format with secs */ - sprintf ((char *)buf, "%d:%02d:%02d", + sprintf ((char *)buf, "%02d:%02d:%02d", job->run_tm.tm_hour, job->run_tm.tm_min, job->run_tm.tm_sec); @@ -514,7 +514,7 @@ break; case '*': /* `$*' modif time in 24-hour format with secs */ - sprintf ((char *)buf, "%d:%02d:%02d", + sprintf ((char *)buf, "%02d:%02d:%02d", file->mod_tm.tm_hour, file->mod_tm.tm_min, file->mod_tm.tm_sec); @@ -622,7 +622,7 @@ break; case 'C': /* `$C' modtime in `hh:mm:ss' format */ - sprintf ((char *)buf, "%d:%02d:%02d", + sprintf ((char *)buf, "%02d:%02d:%02d", file->mod_tm.tm_hour, file->mod_tm.tm_min, file->mod_tm.tm_sec); @@ -904,7 +904,7 @@ break; case 'T': /* `$T' runtime in 24-hour format */ - sprintf ((char *)buf, "%d:%02d", + sprintf ((char *)buf, "%02d:%02d", file->mod_tm.tm_hour, file->mod_tm.tm_min); APPEND_STR (buf);