aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bacapp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-05-05 11:03:46 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2005-05-05 11:03:46 +0000
commitb0768a3d03e0200015cc798d6dd0ccf9d10981ad (patch)
treee53c2a7c3b12ad15cb14b3ac1b68367aaadc4bf6 /epan/dissectors/packet-bacapp.c
parenta062964b6d5927683cb4195b896139439f4a7ddc (diff)
Change data types to match those of "iconv()", at least on OS X.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14314 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-bacapp.c')
-rw-r--r--epan/dissectors/packet-bacapp.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c
index 3450457ef8..faf91ec677 100644
--- a/epan/dissectors/packet-bacapp.c
+++ b/epan/dissectors/packet-bacapp.c
@@ -1624,8 +1624,9 @@ static guint
fCharacterString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
{
guint8 tag_no, class_tag, tmp;
- guint32 lvt, outbytesleft = 512, inbytesleft, l;
- guint offs;
+ guint32 lvt, l;
+ size_t inbytesleft, outbytesleft = 512;
+ guint offs;
guint8 *str_val;
guint8 bf_arr[512], *out = &bf_arr[0];
@@ -1651,6 +1652,22 @@ fCharacterString (tvbuff_t *tvb, proto_tree *tree, guint offset, guint8 *label)
}
do {
l = inbytesleft = min(lvt, 255);
+ /*
+ * XXX - are we guaranteed that these encoding
+ * names correspond, on *all* platforms with
+ * iconv(), to the encodings we want?
+ * If not (and perhaps even if so), we should
+ * perhaps have our own iconv() implementation,
+ * with a different name, so that we control the
+ * encodings it supports and the names of those
+ * encodings.
+ *
+ * We should also handle that in the general
+ * string handling code, rather than making it
+ * specific to the BACAPP dissector, as many
+ * other dissectors need to handle various
+ * character encodings.
+ */
str_val = tvb_get_string(tvb, offset, l);
/** this decoding may be not correct for multi-byte characters, Lka */
switch (tmp) {
@@ -5230,19 +5247,21 @@ proto_reg_handoff_bacapp(void)
}
guint32
-fConvertXXXtoUTF8 (guint8 *in, guint32 *inbytesleft, guint8 *out, guint32 *outbytesleft, guint8 *fromcoding)
+fConvertXXXtoUTF8 (const guint8 *in, size_t *inbytesleft, guint8 *out, size_t *outbytesleft, guint8 *fromcoding)
{ /* I don't want to let in and out be modified */
#ifdef HAVE_CONFIG_H
#if HAVE_ICONV_H
guint32 i;
- iconv_t icd;
- guint8 *inp = in, *outp = out;
- guint8 **inpp = &inp, **outpp = &outp;
+ iconv_t icd;
+ const guint8 *inp = in;
+ guint8 *outp = out;
+ const guint8 **inpp = &inp;
+ guint8 **outpp = &outp;
if ((icd = iconv_open ("UTF-8", fromcoding)) != (iconv_t) -1) {
- i = iconv (icd, (char**) inpp, inbytesleft, (char**) outpp, outbytesleft);
- *outpp[0] = '\0';
+ i = iconv (icd, (const char**) inpp, inbytesleft, (char**) outpp, outbytesleft);
+ *outpp[0] = '\0';
iconv_close (icd);
return i;
}