Add a new "tvb_strsize()" routine, which finds the size of a
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 25 Dec 2000 23:48:16 +0000 (23:48 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 25 Dec 2000 23:48:16 +0000 (23:48 +0000)
commit2bfe61edb32a137b872f855d23eb9ff1e5e4bdf8
treed0fb0cddaeb9f6b9f9737b7efa7b00cabf6243eb
parent899bafb217fbe6e9203200c56ad496dce3eb427a
Add a new "tvb_strsize()" routine, which finds the size of a
NUL-terminated string, starting at a given offset.  The size includes
the terminating NUL.  If it doesn't find the terminating NUL, it throws
the appropriate exception, as either there's no terminating NUL in the
packet or there is but it's past the end of the captured data in the
packet.

Use that routine in the TFTP dissector.  As it throws an exception if
the string isn't NUL-terminated, we can just use "%s" to print option
strings; we don't need to use "%.*s" with a string length.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2783 f5534014-38df-0310-8fa8-9805f1628bb7
epan/tvbuff.c
epan/tvbuff.h
packet-tftp.c