aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/sha1.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 /wsutil/sha1.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 'wsutil/sha1.c')
-rw-r--r--wsutil/sha1.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/wsutil/sha1.c b/wsutil/sha1.c
index 3aaf557052..9b115d56b2 100644
--- a/wsutil/sha1.c
+++ b/wsutil/sha1.c
@@ -339,6 +339,7 @@ void sha1_hmac( const guint8 *key, guint32 keylen, const guint8 *buf, guint32 bu
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
+#include <wsutil/ws_printf.h> /* ws_debug_printf */
/*
* those are the standard FIPS-180-1 test vectors
@@ -369,11 +370,11 @@ int main( int argc, char *argv[] )
if( argc < 2 )
{
- printf( "\n SHA-1 Validation Tests:\n\n" );
+ ws_debug_printf( "\n SHA-1 Validation Tests:\n\n" );
for( i = 0; i < 3; i++ )
{
- printf( " Test %d ", i + 1 );
+ ws_debug_printf( " Test %d ", i + 1 );
sha1_starts( &ctx );
@@ -401,20 +402,20 @@ int main( int argc, char *argv[] )
if( memcmp( output, val[i], 40 ) )
{
- printf( "failed!\n" );
+ ws_debug_printf( "failed!\n" );
return( 1 );
}
- printf( "passed.\n" );
+ ws_debug_printf( "passed.\n" );
}
- printf( "\n" );
+ ws_debug_printf( "\n" );
}
else
{
if( ! ( f = ws_fopen( argv[1], "rb" ) ) )
{
- printf("fopen: %s", g_strerror(errno));
+ ws_debug_printf("fopen: %s", g_strerror(errno));
return( 1 );
}
@@ -429,10 +430,10 @@ int main( int argc, char *argv[] )
for( j = 0; j < SHA1_DIGEST_LEN; j++ )
{
- printf( "%02x", sha1sum[j] );
+ ws_debug_printf( "%02x", sha1sum[j] );
}
- printf( " %s\n", argv[1] );
+ ws_debug_printf( " %s\n", argv[1] );
}
return( 0 );