Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 45566: /trunk/epan/dissectors/ /trun
From: Martin Kaiser <lists@xxxxxxxxx>
Date: Thu, 18 Oct 2012 23:11:27 +0200
Hi,

Thus wrote Maynard, Chris (Christopher.Maynard@xxxxxxxxx):

> Recently, I found and fixed some of these problems, but obviously I
> didn't catch them all.  Are there any more thoughts about changing
> tvb_length_remaining() and tvb_reported_length_remaining() to return 0
> instead of -1?

it looks like there's quite a few places where people used an unsigned
return value (I just fixed a few obvious cases).
I guess we should do something about this in the tvb part rather than in
the dissectors. 

What's the difference between return value 0 and -1 now? Both are
essentially saying there's no data left, -1 is an error case and 0
isn't? Is that significant to the caller, what can he do other than stop
reading?

   Martin