The last byte of "foo[N]" is "foo[N-1]", not "foo[N]".

svn path=/trunk/; revision=7740
This commit is contained in:
Guy Harris 2003-05-25 19:37:36 +00:00
parent 75648fb892
commit 181be03665
3 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
* $Id: packet-ieee80211.c,v 1.87 2003/05/24 17:45:10 gerald Exp $
* $Id: packet-ieee80211.c,v 1.88 2003/05/25 19:35:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -765,7 +765,7 @@ add_tagged_field (proto_tree * tree, tvbuff_t * tvb, int offset)
if (n < SHORT_STR)
snprintf (out_buff + n, SHORT_STR - n, "[Mbit/sec]");
out_buff[SHORT_STR] = '\0';
out_buff[SHORT_STR-1] = '\0';
proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
tag_len, out_buff);
break;

View File

@ -4,7 +4,7 @@
* for ISAKMP (RFC 2407)
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
* $Id: packet-isakmp.c,v 1.63 2003/05/25 16:49:47 gerald Exp $
* $Id: packet-isakmp.c,v 1.64 2003/05/25 19:37:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1133,7 +1133,7 @@ situation2str(guint32 type) {
ret = snprintf(msg, SIT_MSG_NUM-n, "%sIDENTITY", sep);
if (ret == -1 || ret >= SIT_MSG_NUM-n) {
/* Truncated. */
msg[SIT_MSG_NUM] = '\0';
msg[SIT_MSG_NUM-1] = '\0';
return msg;
}
n += ret;
@ -1147,7 +1147,7 @@ situation2str(guint32 type) {
ret = snprintf(msg, SIT_MSG_NUM-n, "%sSECRECY", sep);
if (ret == -1 || ret >= SIT_MSG_NUM-n) {
/* Truncated. */
msg[SIT_MSG_NUM] = '\0';
msg[SIT_MSG_NUM-1] = '\0';
return msg;
}
n += ret;
@ -1161,7 +1161,7 @@ situation2str(guint32 type) {
ret = snprintf(msg, SIT_MSG_NUM-n, "%sINTEGRITY", sep);
if (ret == -1 || ret >= SIT_MSG_NUM-n) {
/* Truncated. */
msg[SIT_MSG_NUM] = '\0';
msg[SIT_MSG_NUM-1] = '\0';
return msg;
}
n += ret;

View File

@ -2,7 +2,7 @@
*
* Routines to dissect WSP component of WAP traffic.
*
* $Id: packet-wsp.c,v 1.68 2003/05/24 17:45:10 gerald Exp $
* $Id: packet-wsp.c,v 1.69 2003/05/25 19:36:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -3177,7 +3177,7 @@ add_capabilities (proto_tree *tree, tvbuff_t *tvb, int type)
i += ret;
}
add_string:
valString[VAL_STRING_SIZE] = '\0';
valString[VAL_STRING_SIZE-1] = '\0';
proto_tree_add_string(wsp_capabilities, hf_wsp_capabilities_protocol_opt, tvb, capabilitiesStart, length+1, valString);
break;
case 0x03 : /* Method-MOR */