Bprint didn't seem to like %u, giving the following output:

[egates-vm 9base 686]$ cal/cal
   June %
% S  M Tu  W Th  F  S
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Changing to %d fixes this:

[egates-vm 9base 692]$ cal/cal
   June 2015
 S  M Tu  W Th  F  S
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Patch attached.
-emg
From ae17848c795860d34d358fb50f5c2188e59ec2e4 Mon Sep 17 00:00:00 2001
From: Evan Gates <evan.ga...@gmail.com>
Date: Thu, 18 Jun 2015 10:57:29 -0700
Subject: [PATCH] change %u to %d

---
 cal/cal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cal/cal.c b/cal/cal.c
index 3f1e075..36dd9dd 100644
--- a/cal/cal.c
+++ b/cal/cal.c
@@ -84,7 +84,7 @@ xshort:
                goto badarg;
        if(y < 1 || y > 9999)
                goto badarg;
-       Bprint(&bout, "   %s %u\n", smon[m-1], y);
+       Bprint(&bout, "   %s %d\n", smon[m-1], y);
        Bprint(&bout, "%s\n", dayw);
        cal(m, y, string, 24);
        for(i=0; i<6*24; i+=24)
@@ -99,7 +99,7 @@ xlong:
        if(y<1 || y>9999)
                goto badarg;
        Bprint(&bout, "\n\n\n");
-       Bprint(&bout, "                                %u\n", y);
+       Bprint(&bout, "                                %d\n", y);
        Bprint(&bout, "\n");
        for(i=0; i<12; i+=3) {
                for(j=0; j<6*72; j++)
-- 
2.4.4

Reply via email to