diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2015-06-27 06:10:20 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-06-27 14:32:35 +0000 |
commit | b24a45c354f95e27e30dbcc0e9e3ef3af4676e9c (patch) | |
tree | 01895e45535de45abc417760316c76c99bae854f | |
parent | 26a1ccbc05f0dfd425393d1455cfc0de0f253f3e (diff) |
Avoid some Visual Studio Code Anaylzer warnings
Change-Id: I320386b02bea09658636a9281ee3cbba34a5e4cd
Reviewed-on: https://code.wireshark.org/review/9188
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/guid-utils.c | 4 | ||||
-rw-r--r-- | epan/tap.c | 2 | ||||
-rw-r--r-- | rawshark.c | 14 | ||||
-rw-r--r-- | ui/cli/tap-srt.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/epan/guid-utils.c b/epan/guid-utils.c index e8f786222c..c0a915b31f 100644 --- a/epan/guid-utils.c +++ b/epan/guid-utils.c @@ -50,8 +50,8 @@ ResolveWin32UUID(e_guid_t if_id, char *uuid_name, int uuid_name_max_len) DWORD uuid_max_size = MAX_PATH; TCHAR *reg_uuid_str; - reg_uuid_name=wmem_alloc(wmem_packet_scope(), MAX_PATH*sizeof(TCHAR)); - reg_uuid_str=wmem_alloc(wmem_packet_scope(), MAX_PATH*sizeof(TCHAR)); + reg_uuid_name=wmem_alloc(wmem_packet_scope(), (MAX_PATH*sizeof(TCHAR))+1); + reg_uuid_str=wmem_alloc(wmem_packet_scope(), (MAX_PATH*sizeof(TCHAR))+1); if(uuid_name_max_len < 2){ return 0; diff --git a/epan/tap.c b/epan/tap.c index 605c4990ee..c0b7f92c2f 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -352,7 +352,7 @@ tap_push_tapped_queue(epan_dissect_t *edt) for(tl=(tap_listener_t *)tap_listener_queue;tl;tl=tl->next){ tp=&tap_packet_array[i]; /* Don't tap the packet if it's an "error" unless the listener tells us to */ - if ((!tp->flags & TAP_PACKET_IS_ERROR_PACKET) || (tl->flags & TL_REQUIRES_ERROR_PACKETS)) + if (!(tp->flags & TAP_PACKET_IS_ERROR_PACKET) || (tl->flags & TL_REQUIRES_ERROR_PACKETS)) { if(tp->tap_id==tl->tap_id){ gboolean passed=TRUE; diff --git a/rawshark.c b/rawshark.c index 1561b8ac45..443b4b4258 100644 --- a/rawshark.c +++ b/rawshark.c @@ -319,7 +319,7 @@ raw_pipe_open(const char *pipe_name) if (err != ERROR_PIPE_BUSY) { FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, (LPTSTR) &err_str, 0, NULL); - fprintf(stderr, "rawshark: \"%s\" could not be opened: %s (error %d)\n", + fprintf(stderr, "rawshark: \"%s\" could not be opened: %s (error %lu)\n", pipe_name, utf_16to8(err_str), err); LocalFree(err_str); return -1; @@ -329,7 +329,7 @@ raw_pipe_open(const char *pipe_name) err = GetLastError(); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, (LPTSTR) &err_str, 0, NULL); - fprintf(stderr, "rawshark: \"%s\" could not be waited for: %s (error %d)\n", + fprintf(stderr, "rawshark: \"%s\" could not be waited for: %s (error %lu)\n", pipe_name, utf_16to8(err_str), err); LocalFree(err_str); return -1; @@ -1391,13 +1391,13 @@ static gboolean print_field_value(field_info *finfo, int cmd_line_index) } } } - printf(" %u=\"%s\"", cmd_line_index, label_s->str); + printf(" %d=\"%s\"", cmd_line_index, label_s->str); return TRUE; } if(finfo->value.ftype->val_to_string_repr) { - printf(" %u=\"%s\"", cmd_line_index, fs_ptr); + printf(" %d=\"%s\"", cmd_line_index, fs_ptr); return TRUE; } @@ -1406,7 +1406,7 @@ static gboolean print_field_value(field_info *finfo, int cmd_line_index) * e.g. http * We return n.a. */ - printf(" %u=\"n.a.\"", cmd_line_index); + printf(" %d=\"n.a.\"", cmd_line_index); return TRUE; } @@ -1454,14 +1454,14 @@ protocolinfo_init(char *field) switch (hfi->type) { case FT_ABSOLUTE_TIME: - printf("%u %s %s - ", + printf("%d %s %s - ", g_cmd_line_index, ftenum_to_string(hfi), absolute_time_display_e_to_string((absolute_time_display_e)hfi->display)); break; default: - printf("%u %s %s - ", + printf("%d %s %s - ", g_cmd_line_index, ftenum_to_string(hfi), field_display_e_to_string((field_display_e)hfi->display)); diff --git a/ui/cli/tap-srt.c b/ui/cli/tap-srt.c index 91c26f86d6..32fde53594 100644 --- a/ui/cli/tap-srt.c +++ b/ui/cli/tap-srt.c @@ -64,7 +64,7 @@ draw_srt_table_data(srt_stat_table *rst, gboolean draw_footer) sum = (td + 500) / 1000; td = ((td / rst->procedures[i].stats.num) + 500) / 1000; - printf("%5u %-22s %6u %3d.%06d %3d.%06d %3d.%06d %3d.%06d\n", + printf("%5d %-22s %6u %3d.%06d %3d.%06d %3d.%06d %3d.%06d\n", i, rst->procedures[i].procedure, rst->procedures[i].stats.num, (int)rst->procedures[i].stats.min.secs, (rst->procedures[i].stats.min.nsecs+500)/1000, |