aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tacacs.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-24 08:53:39 -0400
committerAnders Broman <a.broman58@gmail.com>2016-07-25 04:26:50 +0000
commit1da1f945e2988080add4923dc2021753e3b2f7c1 (patch)
tree2839b66064e34ba99a6d031778330f20497b5e93 /epan/dissectors/packet-tacacs.c
parentee7f9c33f63532bc69899a0750177756be53c0c1 (diff)
Fix checkAPI.pl warnings about printf
Many of the complaints from checkAPI.pl for use of printf are when its embedded in an #ifdef and checkAPI isn't smart enough to figure that out. The other (non-ifdef) use is dumping internal structures (which is a type of debug functionality) Add a "ws_debug_printf" macro for printf to pacify the warnings. Change-Id: I63610e1adbbaf2feffb4ec9d4f817247d833f7fd Reviewed-on: https://code.wireshark.org/review/16623 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-tacacs.c')
-rw-r--r--epan/dissectors/packet-tacacs.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index 5054f90126..bf40af19c3 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -39,6 +39,7 @@
#include <epan/expert.h>
#include <epan/addr_resolv.h>
#include <wsutil/md5.h>
+#include <wsutil/ws_printf.h> /* ws_debug_printf */
#include "packet-tacacs.h"
@@ -749,9 +750,9 @@ tacplus_print_key_entry( gpointer data, gpointer user_data )
s_str = address_to_str( NULL, tacplus_data->s );
c_str = address_to_str( NULL, tacplus_data->c );
if( user_data ) {
- printf("%s:%s=%s\n", s_str, c_str, tacplus_data->k );
+ ws_debug_printf("%s:%s=%s\n", s_str, c_str, tacplus_data->k );
} else {
- printf("%s:%s\n", s_str, c_str );
+ ws_debug_printf("%s:%s\n", s_str, c_str );
}
wmem_free(NULL, s_str);
wmem_free(NULL, c_str);
@@ -764,9 +765,9 @@ cmp_conv_address( gconstpointer p1, gconstpointer p2 )
const tacplus_key_entry *a2=(const tacplus_key_entry *)p2;
gint32 ret;
/*
- printf("p1=>");
+ ws_debug_printf("p1=>");
tacplus_print_key_entry( p1, NULL );
- printf("p2=>");
+ ws_debug_printf("p2=>");
tacplus_print_key_entry( p2, NULL );
*/
ret=cmp_address( a1->s, a2->s );
@@ -774,9 +775,9 @@ cmp_conv_address( gconstpointer p1, gconstpointer p2 )
ret=cmp_address( a1->c, a2->c );
/*
if(ret)
- printf("No Client found!"); */
+ ws_debug_printf("No Client found!"); */
} else {
- /* printf("No Server found!"); */
+ /* ws_debug_printf("No Server found!"); */
}
return ret;
}
@@ -789,10 +790,10 @@ find_key( address *srv, address *cln )
data.s=srv;
data.c=cln;
-/* printf("Looking for: ");
+/* ws_debug_printf("Looking for: ");
tacplus_print_key_entry( (gconstpointer)&data, NULL ); */
match=g_slist_find_custom( tacplus_keys, (gpointer)&data, cmp_conv_address );
-/* printf("Finished (%p)\n", match); */
+/* ws_debug_printf("Finished (%p)\n", match); */
if( match )
return ((tacplus_key_entry*)match->data)->k;
@@ -819,7 +820,7 @@ parse_tuple( char *key_from_option )
char *client,*key;
tacplus_key_entry *tacplus_data=(tacplus_key_entry *)g_malloc( sizeof(tacplus_key_entry) );
/*
- printf("keys: %s\n", key_from_option );
+ ws_debug_printf("keys: %s\n", key_from_option );
*/
client=strchr(key_from_option,'/');
if(!client) {
@@ -834,7 +835,7 @@ parse_tuple( char *key_from_option )
}
*key++='\0';
/*
- printf("%s %s => %s\n", key_from_option, client, key );
+ ws_debug_printf("%s %s => %s\n", key_from_option, client, key );
*/
mkipv4_address( &tacplus_data->s, key_from_option );
mkipv4_address( &tacplus_data->c, client );