Ethereal-dev: [Ethereal-dev] Signed versus unsigned offset in tvbuffer (was: Question about as

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxx>
Date: Fri, 23 Jan 2004 11:52:13 +0100
| From: Joerg Mayer
| 
| I just had a look at plugins/asn1/packet-asn1.c to reduce the 
| number of
| signed/unsigned warnings. The easiest way to fix many of them would be
| to change the type of offset from int to guint. This type is used in
| asn1_open, asn1_close etc in asn1.c
| Further investigation shows, that a value of -1 indicates an error
| condition. In one case, there's a check in asn1.c whether offset is
| less than -1. So my question is: Can offset in asn1.c be made an
| unsigned int?

I'd even want to have offset always being a gint32 as the
tvb_XXX() methods use signed offsets (negative means: count
from end of buffer). It is impossible to have an offset
bigger than a gint32 today, so maybe we should update the
code of all dissectors to always use a signed 32-bit int.

Regards,

Olivier