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

Diff for /src/usr.bin/calendar/day.c between version 1.2 and 1.3

version 1.2, 1997/08/26 23:37:21 version 1.3, 1998/02/23 05:48:42
Line 97 
Line 97 
   
         for (i = 0; i < 7; i++) {          for (i = 0; i < 7; i++) {
                 tm.tm_wday = i;                  tm.tm_wday = i;
                 strftime(buf, sizeof(buf), "%a", &tm);                  l = strftime(buf, sizeof(buf), "%a", &tm);
                 for (l = strlen(buf);                  for (; l > 0 && isspace((int)buf[l - 1]); l--)
                      l > 0 && isspace((int)buf[l - 1]);  
                      l--)  
                         ;                          ;
                 buf[l] = '\0';                  buf[l] = '\0';
                 if (ndays[i].name != NULL)                  if (ndays[i].name != NULL)
Line 109 
Line 107 
                         errx(1, "cannot allocate memory");                          errx(1, "cannot allocate memory");
                 ndays[i].len = strlen(buf);                  ndays[i].len = strlen(buf);
   
                 strftime(buf, sizeof(buf), "%A", &tm);                  l = strftime(buf, sizeof(buf), "%A", &tm);
                 for (l = strlen(buf);                  for (; l > 0 && isspace((int)buf[l - 1]); l--)
                      l > 0 && isspace((int)buf[l - 1]);  
                      l--)  
                         ;                          ;
                 buf[l] = '\0';                  buf[l] = '\0';
                 if (fndays[i].name != NULL)                  if (fndays[i].name != NULL)
Line 124 
Line 120 
   
         for (i = 0; i < 12; i++) {          for (i = 0; i < 12; i++) {
                 tm.tm_mon = i;                  tm.tm_mon = i;
                 strftime(buf, sizeof(buf), "%b", &tm);                  l = strftime(buf, sizeof(buf), "%b", &tm);
                 for (l = strlen(buf);                  for (; l > 0 && isspace((int)buf[l - 1]); l--)
                      l > 0 && isspace((int)buf[l - 1]);  
                      l--)  
                         ;                          ;
                 buf[l] = '\0';                  buf[l] = '\0';
                 if (nmonths[i].name != NULL)                  if (nmonths[i].name != NULL)
Line 136 
Line 130 
                         errx(1, "cannot allocate memory");                          errx(1, "cannot allocate memory");
                 nmonths[i].len = strlen(buf);                  nmonths[i].len = strlen(buf);
   
                 strftime(buf, sizeof(buf), "%B", &tm);                  l = strftime(buf, sizeof(buf), "%B", &tm);
                 for (l = strlen(buf);                  for (; l > 0 && isspace((int)buf[l - 1]); l--)
                      l > 0 && isspace((int)buf[l - 1]);  
                      l--)  
                         ;                          ;
                 buf[l] = '\0';                  buf[l] = '\0';
                 if (fnmonths[i].name != NULL)                  if (fnmonths[i].name != NULL)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3