The packet length is an unsigned quantity; print it with "%u".
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 10 Dec 2001 02:15:54 +0000 (02:15 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 10 Dec 2001 02:15:54 +0000 (02:15 +0000)
If we get an illegal column type in "fill_in_columns()", crash.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4373 f5534014-38df-0310-8fa8-9805f1628bb7

epan/column-utils.c

index 4e57baaa429183f275ffce0bc4725f82f9dd8c1f..dbae5d6ee3bb532ef584cae75df43218f1eb3e1d 100644 (file)
@@ -1,7 +1,7 @@
 /* column-utils.c
  * Routines for column utilities.
  *
- * $Id: column-utils.c,v 1.8 2001/12/10 00:26:16 guy Exp $
+ * $Id: column-utils.c,v 1.9 2001/12/10 02:15:54 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -557,11 +557,12 @@ fill_in_columns(packet_info *pinfo)
       break;
 
     case COL_PACKET_LENGTH:
-      snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%d", pinfo->fd->pkt_len);
+      snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->fd->pkt_len);
       pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
       break;
 
     case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */
+      g_assert_not_reached();
       break;
     }
   }