"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/osipparser2/osip_content_type.c" between
libosip2-5.0.0.tar.gz and libosip2-5.1.0.tar.gz

About: The GNU oSIP library is an implementation of SIP (RFC3261).

osip_content_type.c  (libosip2-5.0.0):osip_content_type.c  (libosip2-5.1.0)
skipping to change at line 166 skipping to change at line 166
buf = (char *) osip_malloc (len); buf = (char *) osip_malloc (len);
if (buf == NULL) if (buf == NULL)
return OSIP_NOMEM; return OSIP_NOMEM;
tmp = buf; tmp = buf;
sprintf (tmp, "%s/%s", content_type->type, content_type->subtype); sprintf (tmp, "%s/%s", content_type->type, content_type->subtype);
tmp = tmp + strlen (tmp); tmp = tmp + strlen (tmp);
{ {
osip_list_iterator_t it; osip_list_iterator_t it;
osip_generic_param_t *u_param = (osip_generic_param_t*) osip_list_get_first( osip_generic_param_t *u_param = (osip_generic_param_t *) osip_list_get_first
&content_type->gen_params, &it); (&content_type->gen_params, &it);
while (u_param != OSIP_SUCCESS) { while (u_param != OSIP_SUCCESS) {
size_t tmp_len; size_t tmp_len;
if (u_param->gvalue == NULL) { if (u_param->gvalue == NULL) {
osip_free (buf); osip_free (buf);
return OSIP_SYNTAXERROR; return OSIP_SYNTAXERROR;
} }
tmp_len = strlen (buf) + 4 + strlen (u_param->gname) tmp_len = strlen (buf) + 4 + strlen (u_param->gname)
+ strlen (u_param->gvalue) + 1; + strlen (u_param->gvalue) + 1;
if (len < tmp_len) { if (len < tmp_len) {
buf = osip_realloc (buf, tmp_len); buf = osip_realloc (buf, tmp_len);
len = tmp_len; len = tmp_len;
tmp = buf + strlen (buf); tmp = buf + strlen (buf);
} }
snprintf (tmp, len - (tmp - buf), "; %s=%s", u_param->gname, u_param->gval ue); snprintf (tmp, len - (tmp - buf), "; %s=%s", u_param->gname, u_param->gval ue);
tmp = tmp + strlen (tmp); tmp = tmp + strlen (tmp);
u_param = (osip_generic_param_t *) osip_list_get_next(&it); u_param = (osip_generic_param_t *) osip_list_get_next (&it);
} }
} }
*dest = buf; *dest = buf;
return OSIP_SUCCESS; return OSIP_SUCCESS;
} }
/* deallocates a osip_content_type_t structure. */ /* deallocates a osip_content_type_t structure. */
/* INPUT : osip_content_type_t *content_type | content_type. */ /* INPUT : osip_content_type_t *content_type | content_type. */
void void
osip_content_type_free (osip_content_type_t * content_type) osip_content_type_free (osip_content_type_t * content_type)
skipping to change at line 228 skipping to change at line 230
if (i != 0) /* allocation failed */ if (i != 0) /* allocation failed */
return i; return i;
if (ctt->type != NULL) if (ctt->type != NULL)
ct->type = osip_strdup (ctt->type); ct->type = osip_strdup (ctt->type);
if (ctt->subtype != NULL) if (ctt->subtype != NULL)
ct->subtype = osip_strdup (ctt->subtype); ct->subtype = osip_strdup (ctt->subtype);
{ {
osip_generic_param_t *dest_param; osip_generic_param_t *dest_param;
osip_list_iterator_t it; osip_list_iterator_t it;
osip_generic_param_t *u_param = (osip_generic_param_t*) osip_list_get_first( osip_generic_param_t *u_param = (osip_generic_param_t *) osip_list_get_first
&ctt->gen_params, &it); (&ctt->gen_params, &it);
while (u_param != OSIP_SUCCESS) { while (u_param != OSIP_SUCCESS) {
i = osip_generic_param_clone (u_param, &dest_param); i = osip_generic_param_clone (u_param, &dest_param);
if (i != 0) { if (i != 0) {
osip_content_type_free (ct); osip_content_type_free (ct);
return i; return i;
} }
osip_list_add (&ct->gen_params, dest_param, -1); osip_list_add (&ct->gen_params, dest_param, -1);
u_param = (osip_generic_param_t *) osip_list_get_next(&it); u_param = (osip_generic_param_t *) osip_list_get_next (&it);
} }
} }
*dest = ct; *dest = ct;
return OSIP_SUCCESS; return OSIP_SUCCESS;
} }
 End of changes. 5 change blocks. 
6 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)