Use platform layer in programs for consistency.
diff --git a/programs/util/strerror.c b/programs/util/strerror.c
index 79eec18..a4db94c 100644
--- a/programs/util/strerror.c
+++ b/programs/util/strerror.c
@@ -26,6 +26,15 @@
#include POLARSSL_CONFIG_FILE
#endif
+#if defined(POLARSSL_PLATFORM_C)
+#include "polarssl/platform.h"
+#else
+#define polarssl_printf printf
+#define polarssl_fprintf fprintf
+#define polarssl_malloc malloc
+#define polarssl_free free
+#endif
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -42,7 +51,7 @@
((void) argc);
((void) argv);
- printf("POLARSSL_ERROR_C and/or POLARSSL_ERROR_STRERROR_DUMMY not defined.\n");
+ polarssl_printf("POLARSSL_ERROR_C and/or POLARSSL_ERROR_STRERROR_DUMMY not defined.\n");
return( 0 );
}
#else
@@ -53,7 +62,7 @@
if( argc != 2 )
{
- printf( USAGE );
+ polarssl_printf( USAGE );
return( 0 );
}
@@ -63,7 +72,7 @@
val = strtol( argv[1], &end, 16 );
if( *end != '\0' )
{
- printf( USAGE );
+ polarssl_printf( USAGE );
return( 0 );
}
}
@@ -74,11 +83,11 @@
{
char error_buf[200];
polarssl_strerror( val, error_buf, 200 );
- printf("Last error was: -0x%04x - %s\n\n", (int) -val, error_buf );
+ polarssl_printf("Last error was: -0x%04x - %s\n\n", (int) -val, error_buf );
}
#if defined(_WIN32)
- printf( " + Press Enter to exit this program.\n" );
+ polarssl_printf( " + Press Enter to exit this program.\n" );
fflush( stdout ); getchar();
#endif