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

Diff for /src/usr.bin/ftp/fetch.c between version 1.204 and 1.205

version 1.204, 2021/03/29 03:34:52 version 1.205, 2021/08/31 09:51:25
Line 1574 
Line 1574 
   
         if (str == NULL)          if (str == NULL)
                 return NULL;                  return NULL;
         if ((ret = malloc(strlen(str)+1)) == NULL)          if ((ret = malloc(strlen(str) + 1)) == NULL)
                 err(1, "Can't allocate memory for URL decoding");                  err(1, "Can't allocate memory for URL decoding");
         for (i = 0, reallen = 0; str[i] != '\0'; i++, reallen++, ret++) {          for (i = 0, reallen = 0; str[i] != '\0'; i++, reallen++, ret++) {
                 c = str[i];                  c = str[i];
Line 1586 
Line 1586 
                 /* Cannot use strtol here because next char                  /* Cannot use strtol here because next char
                  * after %xx may be a digit.                   * after %xx may be a digit.
                  */                   */
                 if (c == '%' && isxdigit((unsigned char)str[i+1]) &&                  if (c == '%' && isxdigit((unsigned char)str[i + 1]) &&
                     isxdigit((unsigned char)str[i+2])) {                      isxdigit((unsigned char)str[i + 2])) {
                         *ret = hextochar(&str[i+1]);                          *ret = hextochar(&str[i + 1]);
                         i+=2;                          i += 2;
                         continue;                          continue;
                 }                  }
                 *ret = c;                  *ret = c;
         }          }
         *ret = '\0';          *ret = '\0';
   
         return ret-reallen;          return ret - reallen;
 }  }
   
 static char *  static char *

Legend:
Removed from v.1.204  
changed lines
  Added in v.1.205