Wireshark-dev: Re: [Wireshark-dev] Warnings in airpcap_dlg.c
From: "Maynard, Chris" <Christopher.Maynard@xxxxxxxxx>
Date: Wed, 13 May 2009 11:55:59 -0400
Or if that still produces a warning, you might also try something like this:
 
const unsigned int wpa_ssid_min_char_size = WPA_SSID_MIN_CHAR_SIZE;
...
if (((new_ssid_string->len) < wpa_ssid_min_char_size))
- Chris

 

From: Maynard, Chris
Sent: Wed 5/13/2009 11:30 AM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] Warnings in airpcap_dlg.c

How about this?
 
if (WPA_SSID_MIN_CHAR_SIZE && ((new_ssid_string->len) < WPA_SSID_MIN_CHAR_SIZE))
As long as WPA_SSID_MIN_CHAR_SIZE is defined as 0, the compiler will probably just optimize it away, but if it ever changes to a value greater than zero, your check will be there.
 
- Chris
 


From: Stig Bjørlykke
Sent: Wed 5/13/2009 6:37 AM
To: Developer support list for Wireshark
Subject: [Wireshark-dev] Warnings in airpcap_dlg.c

Hi.

We have some warnings in airpcap_dlg.c where we check an unsigned
variable against a define with value zero.
Any ideas how we should fix this?  Removing the check is not what I wanted.

The code is like this:

#define WPA_SSID_MIN_CHAR_SIZE 0
GString *new_ssid_string;

if (((new_ssid_string->len) < WPA_SSID_MIN_CHAR_SIZE))


-- 
Stig Bjørlykke
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
 
CONFIDENTIALITY NOTICE: The contents of this email are confidential
and for the exclusive use of the intended recipient. If you receive this
email in error, please delete it from your system immediately and 
notify us either by email, telephone or fax. You should not copy,
forward, or otherwise disclose the content of the email.