src/etpan_mime.c
branchENGINE-9
changeset 1881 facb0b5b0bce
parent 1878 aa44c9c98214
child 1892 4ce6a6903bfa
child 1900 0aa3e9e7c850
     1.1 --- a/src/etpan_mime.c	Wed Jun 21 13:20:50 2017 +0200
     1.2 +++ b/src/etpan_mime.c	Wed Jun 21 13:43:55 2017 +0200
     1.3 @@ -620,22 +620,6 @@
     1.4      return content;
     1.5  }
     1.6  
     1.7 -char* _build_uri(char* uri_prefix, char* resource) {
     1.8 -    if (!uri_prefix || !resource)
     1.9 -        return NULL;
    1.10 -    const char* delim = "://";
    1.11 -    const int delim_len = 3;
    1.12 -    int prefix_len = strlen(uri_prefix);
    1.13 -    int resource_len = strlen(resource);
    1.14 -    int retval_len = prefix_len + delim_len + resource_len;
    1.15 -
    1.16 -    char* retval = calloc(1, retval_len + 1);
    1.17 -    strlcpy(retval, uri_prefix, retval_len);
    1.18 -    strlcat(retval, delim, retval_len);
    1.19 -    strlcat(retval, resource, retval_len);
    1.20 -    
    1.21 -    return retval;
    1.22 -}
    1.23  
    1.24  /* Return a list of identifier_type and resource id (filename, cid, etc) */
    1.25  pEp_rid_list_t* _get_resource_id_list(struct mailmime *mime)
    1.26 @@ -712,7 +696,7 @@
    1.27          if (_field && _field->fld_type == MAILMIME_FIELD_ID) {
    1.28              /* We prefer CIDs to filenames when both are present */
    1.29              free(_temp_filename_ptr); /* can be null, it's ok */
    1.30 -            return _build_uri("cid", _field->fld_data.fld_id); 
    1.31 +            return build_uri("cid", _field->fld_data.fld_id); 
    1.32          }
    1.33          else if (_field && _field->fld_type == MAILMIME_FIELD_DISPOSITION) {
    1.34              if (_field->fld_data.fld_disposition &&
    1.35 @@ -726,7 +710,7 @@
    1.36                      struct mailmime_disposition_parm * param =
    1.37                              clist_content(cur2);
    1.38                      if (param->pa_type == MAILMIME_DISPOSITION_PARM_FILENAME) {
    1.39 -                        _temp_filename_ptr = _build_uri("file", param->pa_data.pa_filename);
    1.40 +                        _temp_filename_ptr = build_uri("file", param->pa_data.pa_filename);
    1.41                          break;
    1.42                      }                
    1.43                  }