"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/osipparser2/osip_accept_encoding.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_accept_encoding.c  (libosip2-5.0.0):osip_accept_encoding.c  (libosip2-5.1.0)
skipping to change at line 129 skipping to change at line 129
len = strlen (accept_encoding->element) + 2; len = strlen (accept_encoding->element) + 2;
buf = (char *) osip_malloc (len); buf = (char *) osip_malloc (len);
if (buf == NULL) if (buf == NULL)
return OSIP_NOMEM; return OSIP_NOMEM;
sprintf (buf, "%s", accept_encoding->element); sprintf (buf, "%s", accept_encoding->element);
{ {
size_t plen; size_t plen;
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
&accept_encoding->gen_params, &it); (&accept_encoding->gen_params, &it);
while (u_param != OSIP_SUCCESS) { while (u_param != OSIP_SUCCESS) {
if (u_param->gvalue == NULL) if (u_param->gvalue == NULL)
plen = strlen (u_param->gname) + 2; plen = strlen (u_param->gname) + 2;
else else
plen = strlen (u_param->gname) + strlen (u_param->gvalue) + 3; plen = strlen (u_param->gname) + strlen (u_param->gvalue) + 3;
len = len + plen; len = len + plen;
buf = (char *) osip_realloc (buf, len); buf = (char *) osip_realloc (buf, len);
tmp = buf; tmp = buf;
tmp = tmp + strlen (tmp); tmp = tmp + strlen (tmp);
if (u_param->gvalue == NULL) if (u_param->gvalue == NULL)
snprintf (tmp, len - (tmp - buf), ";%s", u_param->gname); snprintf (tmp, len - (tmp - buf), ";%s", u_param->gname);
else else
snprintf (tmp, len - (tmp - buf), ";%s=%s", u_param->gname, u_param->gva lue); snprintf (tmp, len - (tmp - buf), ";%s=%s", u_param->gname, u_param->gva lue);
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_accept_encoding_t structure. */ /* deallocates a osip_accept_encoding_t structure. */
/* INPUT : osip_accept_encoding_t *accept_encoding | accept_encoding. */ /* INPUT : osip_accept_encoding_t *accept_encoding | accept_encoding. */
void void
osip_accept_encoding_free (osip_accept_encoding_t * accept_encoding) osip_accept_encoding_free (osip_accept_encoding_t * accept_encoding)
skipping to change at line 188 skipping to change at line 189
if (i != 0) /* allocation failed */ if (i != 0) /* allocation failed */
return i; return i;
ct->element = osip_strdup (ctt->element); ct->element = osip_strdup (ctt->element);
if (ct->element == NULL) { if (ct->element == NULL) {
osip_accept_encoding_free (ct); osip_accept_encoding_free (ct);
return OSIP_NOMEM; return OSIP_NOMEM;
} }
{ {
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_accept_encoding_free (ct); osip_accept_encoding_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;
} }
char * char *
osip_accept_encoding_get_element (const osip_accept_encoding_t * ae) osip_accept_encoding_get_element (const osip_accept_encoding_t * ae)
{ {
return ae->element; return ae->element;
 End of changes. 4 change blocks. 
6 lines changed or deleted 8 lines changed or added

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