From Tomas Kukosa: fix "col_set_str()" to work correctly with fenced
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 12 Oct 2004 18:08:23 +0000 (18:08 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 12 Oct 2004 18:08:23 +0000 (18:08 +0000)
columns.

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

epan/column-utils.c

index 08044c759bdbf5495fab3264547c2849ae4d7fa4..ecf245c6dc3110ee0a4dd81b76c8b80455b25297 100644 (file)
@@ -195,7 +195,7 @@ col_set_str(column_info *cinfo, gint el, gchar* str)
 {
   int i;
   int fence;
-  size_t len, max_len;
+  size_t max_len;
 
   if (el == COL_INFO)
        max_len = COL_MAX_INFO_LEN;
@@ -213,8 +213,7 @@ col_set_str(column_info *cinfo, gint el, gchar* str)
          */
         COL_CHECK_APPEND(cinfo, i, max_len);
 
-        len = strlen(cinfo->col_buf[i]);
-        strncat(cinfo->col_buf[i], str, max_len - len);
+        strncpy(&cinfo->col_buf[i][fence], str, max_len - fence);
         cinfo->col_buf[i][max_len - 1] = 0;
       } else {
         /*