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

Diff for /src/usr.bin/ftp/util.c between version 1.22 and 1.23

version 1.22, 1999/12/08 12:57:06 version 1.23, 2000/02/01 20:53:06
Line 565 
Line 565 
         if (command("MDTM %s", file) == COMPLETE) {          if (command("MDTM %s", file) == COMPLETE) {
                 struct tm timebuf;                  struct tm timebuf;
                 int yy, mo, day, hour, min, sec;                  int yy, mo, day, hour, min, sec;
                   /*
                    * time-val = 14DIGIT [ "." 1*DIGIT ]
                    *              YYYYMMDDHHMMSS[.sss]
                    * mdtm-response = "213" SP time-val CRLF / error-response
                    */
                   /* TODO: parse .sss as well, use timespecs. */
                   char *timestr = reply_string;
   
                   /* Repair `19%02d' bug on server side */
                   while (!isspace(*timestr))
                           timestr++;
                   while (isspace(*timestr))
                           timestr++;
                   if (strncmp(timestr, "191", 3) == 0) {
                           fprintf(ttyout,
               "Y2K warning! Fixed incorrect time-val received from server.\n");
                           timestr[0] = ' ';
                           timestr[1] = '2';
                           timestr[2] = '0';
                   }
                 sscanf(reply_string, "%*s %04d%02d%02d%02d%02d%02d", &yy, &mo,                  sscanf(reply_string, "%*s %04d%02d%02d%02d%02d%02d", &yy, &mo,
                         &day, &hour, &min, &sec);                          &day, &hour, &min, &sec);
                 memset(&timebuf, 0, sizeof(timebuf));                  memset(&timebuf, 0, sizeof(timebuf));

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23