summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-02-12 19:48:09 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-02-12 19:48:09 +0000
commite0dc99d9645f0fbbb73b53b010a9def48f285486 (patch)
treea56c903f2e47b6b4e3733d432a67e56beb1f0a06
parentca470c662b2b43b6a65762a7f721cb1c0ca17478 (diff)
Fix minor issues in SDP XML support
-rw-r--r--common/sdp-xml.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/sdp-xml.c b/common/sdp-xml.c
index abebc652..db07f03b 100644
--- a/common/sdp-xml.c
+++ b/common/sdp-xml.c
@@ -265,7 +265,7 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
if (hex) {
appender(data, "encoding=\"hex\" ");
strBuf = (char *) malloc(sizeof(char)
- * (value->unitSize * 2 + 1));
+ * ((value->unitSize-1) * 2 + 1));
/* Unit Size seems to include the size for dtd
It is thus off by 1
@@ -276,7 +276,7 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
"%02x",
(unsigned char) value->val.str[i]);
- strBuf[value->unitSize * 2] = '\0';
+ strBuf[(value->unitSize-1) * 2] = '\0';
}
else {
int j;
@@ -603,7 +603,7 @@ sdp_data_t *sdp_xml_parse_int(const char * data, uint8_t dtd)
buf[0] = data[i];
buf[1] = data[i + 1];
- val.data[i] = strtoul(buf, 0, 16);
+ val.data[i >> 1] = strtoul(buf, 0, 16);
}
ret = sdp_data_alloc(dtd, &val);