From 0ed4f8572e1b32b4dd57304db14351f0e0c59119 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 26 Jun 2006 12:44:31 +0000 Subject: Fix handling of strings --- src/sdp.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src') diff --git a/src/sdp.c b/src/sdp.c index abefca98..fd743b60 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -432,22 +432,6 @@ sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t } memcpy(d->val.str, value, length); - - if (length <= UCHAR_MAX) { - d->unitSize += sizeof(uint8_t); - if (dtd != SDP_URL_STR8 && dtd != SDP_TEXT_STR8) { - if (dtd == SDP_URL_STR16) - dtd = SDP_URL_STR8; - else - dtd = SDP_TEXT_STR8; - } - } else { - d->unitSize += sizeof(uint16_t); - if (dtd == SDP_TEXT_STR8) - dtd = SDP_TEXT_STR16; - else - dtd = SDP_URL_STR16; - } } else { SDPERR("Strings of size > USHRT_MAX not supported\n"); free(d); @@ -742,10 +726,6 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) case SDP_TEXT_STR32: src = (unsigned char *)d->val.str; data_size = d->unitSize - sizeof(uint8_t); - if (data_size - sizeof(uint8_t) <= UCHAR_MAX) - data_size -= sizeof(uint8_t); - else - data_size -= sizeof(uint16_t); sdp_set_seq_len(seqp, data_size); break; case SDP_URL_STR8: @@ -973,7 +953,7 @@ static sdp_data_t *extract_str(const void *p, int *len) SDPDBG("Str : %s\n", s); d->val.str = s; - d->unitSize = n; + d->unitSize = n + sizeof(uint8_t); return d; } -- cgit