URI:
       Re-Add meridiem sign to date string and fix help page - tty-clock - port of tty-clock to OpenBSD, with pledge/unveil added as goodie.
  HTML git clone https://git.drkhsh.at/tty-clock.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 68afd752e34e836cc7cfef61659ff13218d28f6d
   DIR parent a32ee816f7856cb24f6bfef6f2ed91e07d476693
  HTML Author: Martin Duquesnoy <xorg62@gmail.com>
       Date:   Sat, 11 Apr 2009 22:48:43 +0200
       
       Re-Add meridiem sign to date string and fix help page
       
       Diffstat:
         M ttyclock.c                          |      14 ++++++++------
         M ttyclock.h                          |       2 +-
       
       2 files changed, 9 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/ttyclock.c b/ttyclock.c
       @@ -132,6 +132,7 @@ void
        update_hour(void)
        {
             int ihour;
       +     char tmpstr[128];
        
             ttyclock->tm = localtime(&(ttyclock->lt));
             ttyclock->lt = time(NULL);
       @@ -141,7 +142,7 @@ update_hour(void)
             if(ttyclock->option.twelve)
                  ttyclock->meridiem = ((ihour > 12) ? PMSIGN : AMSIGN);
             else
       -          ttyclock->meridiem = "";
       +          ttyclock->meridiem = "\0";
        
             /* Manage hour for twelve mode */
             ihour = ((ttyclock->option.twelve && ihour > 12)  ? (ihour - 12) : ihour);
       @@ -156,10 +157,11 @@ update_hour(void)
             ttyclock->date.minute[1] = ttyclock->tm->tm_min % 10;
        
             /* Set date string */
       -     strftime(ttyclock->date.datestr,
       -              sizeof(ttyclock->date.datestr),
       +     strftime(tmpstr,
       +              sizeof(tmpstr),
                      ttyclock->option.format,
                      ttyclock->tm);
       +     sprintf(ttyclock->date.datestr, "%s%s", tmpstr, ttyclock->meridiem);
        
             /* Set seconds */
             ttyclock->date.second[0] = ttyclock->tm->tm_sec / 10;
       @@ -418,13 +420,13 @@ main(int argc, char **argv)
                  {
                  case 'h':
                  default:
       -               printf("tty-clock usage : tty-clock [-option]                         \n"
       +               printf("usage : tty-clock [-sctrvih] [-C [0-7]] [-f format]           \n"
                              "    -s            Show seconds                                \n"
                              "    -c            Set the clock at the center of the terminal \n"
       -                      "    -C <num>      Set the clock color                         \n"
       +                      "    -C [0-7]      Set the clock color                         \n"
                              "    -t            Set the hour in 12h format                  \n"
                              "    -r            Do rebound the clock                        \n"
       -                      "    -f <format>   Set the date format                         \n"
       +                      "    -f format     Set the date format                         \n"
                              "    -v            Show tty-clock version                      \n"
                              "    -i            Show some info about tty-clock              \n"
                              "    -h            Show this page                              \n");
   DIR diff --git a/ttyclock.h b/ttyclock.h
       @@ -82,7 +82,7 @@ typedef struct
                  unsigned int hour[2];
                  unsigned int minute[2];
                  unsigned int second[2];
       -          char datestr[16];
       +          char datestr[256];
             } date;
        
             /* time.h utils */