modify oid.c to use polarssl_snprintf

This commit is contained in:
Rich Evans 2015-01-30 10:54:04 +00:00
parent 46b0a8d15a
commit 8f3a9436a9

View file

@ -36,6 +36,12 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#if defined(POLARSSL_PLATFORM_C)
#include "polarssl/platform.h"
#else
#define polarssl_snprintf snprintf
#endif
#if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C) #if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
#include "polarssl/x509.h" #include "polarssl/x509.h"
#endif #endif
@ -653,7 +659,7 @@ int oid_get_numeric_string( char *buf, size_t size,
/* First byte contains first two dots */ /* First byte contains first two dots */
if( oid->len > 0 ) if( oid->len > 0 )
{ {
ret = snprintf( p, n, "%d.%d", oid->p[0] / 40, oid->p[0] % 40 ); ret = polarssl_snprintf( p, n, "%d.%d", oid->p[0] / 40, oid->p[0] % 40 );
SAFE_SNPRINTF(); SAFE_SNPRINTF();
} }
@ -670,7 +676,7 @@ int oid_get_numeric_string( char *buf, size_t size,
if( !( oid->p[i] & 0x80 ) ) if( !( oid->p[i] & 0x80 ) )
{ {
/* Last byte */ /* Last byte */
ret = snprintf( p, n, ".%d", value ); ret = polarssl_snprintf( p, n, ".%d", value );
SAFE_SNPRINTF(); SAFE_SNPRINTF();
value = 0; value = 0;
} }