(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/column-utils.c) |
| |
| 561 | | | col_do_append_str(column_info *cinfo, gint el, const gchar* separator, |
| 562 | | | const gchar* str) |
| 563 | | | { |
| 564 | | | int i; |
| 565 | | | size_t len, max_len, sep_len; |
| 566 | | | |
| 567 | | | if (!check_col(cinfo, el)) |
| 568 | | | return; |
| 569 | | | |
| 570 | | | if (el == COL_INFO) |
| 571 | | | max_len = COL_MAX_INFO_LEN; |
| 572 | | | else |
| 573 | | | max_len = COL_MAX_LEN; |
| 574 | | | |
| 575 | | | if (separator == NULL) |
| 576 | | | sep_len = 0; |
| 577 | | | else |
| 578 | | | sep_len = strlen(separator); |
Unused Value
The value assigned to sep_len is never subsequently used on any execution path. |
|
| 579 | | | |
| 580 | | | for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) { |
| 581 | | | if (cinfo->fmt_matx[i][el]) { |
| 582 | | | |
| 583 | | | |
| 584 | | | |
| 585 | | | COL_CHECK_APPEND(cinfo, i, max_len);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/column-utils.c |
| |
184 | #define COL_CHECK_APPEND(cinfo, i, max_len) \ |
185 | if (cinfo->col_data[i] != cinfo->col_buf[i]) { \ |
186 | /* This was set with "col_set_str()"; copy the string they \ |
187 | set it to into the buffer, so we can append to it. */ \ |
188 | g_strlcpy(cinfo->col_buf[i], cinfo->col_data[i], max_len); \ |
189 | cinfo->col_data[i] = cinfo->col_buf[i]; \ |
190 | } |
| |
|
| 586 | | | |
| 587 | | | len = cinfo->col_buf[i][0]; |
| 588 | | | |
| 589 | | | |
| 590 | | | |
| 591 | | | |
| 592 | | | if (separator != NULL) { |
| 593 | | | if (len != 0) { |
| 594 | | | g_strlcat(cinfo->col_buf[i], separator, max_len); |
| 595 | | | } |
| 596 | | | } |
| 597 | | | g_strlcat(cinfo->col_buf[i], str, max_len); |
| 598 | | | } |
| 599 | | | } |
| 600 | | | } |
| |