[BACK]Return to rcstime.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rcs

Diff for /src/usr.bin/rcs/rcstime.c between version 1.4 and 1.5

version 1.4, 2014/04/29 07:44:19 version 1.5, 2014/09/30 11:01:20
Line 36 
Line 36 
         int tzone;          int tzone;
         int pos;          int pos;
         char *h, *m;          char *h, *m;
           const char *errstr;
         struct tm *ltb;          struct tm *ltb;
         time_t now;          time_t now;
   
Line 62 
Line 63 
   
                 memcpy(tb, &rdp->rd_date, sizeof(*tb));                  memcpy(tb, &rdp->rd_date, sizeof(*tb));
   
                 tzone = atoi(h);                  tzone = strtonum(h, -23, 23, &errstr);
                 if ((tzone >= 24) || (tzone <= -24))                  if (errstr)
                         errx(1, "%s: not a known time zone", tz);                          errx(1, "%s: not a known time zone", tz);
   
                 if (pos) {                  if (pos) {
Line 78 
Line 79 
                         tb->tm_hour = 0;                          tb->tm_hour = 0;
   
                 if (m != NULL) {                  if (m != NULL) {
                         tzone = atoi(m);                          tzone = strtonum(m, 0, 59, &errstr);
                         if (tzone >= 60)                          if (errstr)
                                 errx(1, "%s: not a known time zone", tz);                                  errx(1, "%s: not a known minute", m);
   
                         if ((tb->tm_min + tzone) >= 60) {                          if ((tb->tm_min + tzone) >= 60) {
                                 tb->tm_hour++;                                  tb->tm_hour++;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5