diff --git a/library/error.c b/library/error.c index ed0f39eff..1eac108c0 100644 --- a/library/error.c +++ b/library/error.c @@ -1,7 +1,7 @@ /* * Error message information * - * Copyright (C) 2006-2012, Brainspark B.V. + * Copyright (C) 2006-2014, Brainspark B.V. * * This file is part of PolarSSL (http://www.polarssl.org) * Lead Maintainer: Paul Bakker diff --git a/library/version_features.c b/library/version_features.c index d7d2d8fed..568034143 100644 --- a/library/version_features.c +++ b/library/version_features.c @@ -35,12 +35,13 @@ #include -#if defined(_MSC_VER) && !defined snprintf && !defined(EFIX64) && \ +#if defined(_MSC_VER) && !defined strcasecmp && !defined(EFIX64) && \ !defined(EFI32) -#define snprintf _snprintf +#define strcasecmp _stricmp #endif const char *features[] = { +#if defined(POLARSSL_VERSION_FEATURES) #if defined(POLARSSL_HAVE_INT8) "POLARSSL_HAVE_INT8", #endif /* POLARSSL_HAVE_INT8 */ @@ -524,6 +525,7 @@ const char *features[] = { #if defined(POLARSSL_XTEA_C) "POLARSSL_XTEA_C", #endif /* POLARSSL_XTEA_C */ +#endif NULL }; @@ -531,6 +533,9 @@ int version_check_feature( const char *feature ) { const char **idx = features; + if( *idx == NULL ) + return( -2 ); + if( feature == NULL ) return( -1 ); diff --git a/scripts/data_files/version_features.fmt b/scripts/data_files/version_features.fmt index 1b1a91849..92cd6a25d 100644 --- a/scripts/data_files/version_features.fmt +++ b/scripts/data_files/version_features.fmt @@ -35,9 +35,9 @@ #include -#if defined(_MSC_VER) && !defined snprintf && !defined(EFIX64) && \ +#if defined(_MSC_VER) && !defined strcasecmp && !defined(EFIX64) && \ !defined(EFI32) -#define snprintf _snprintf +#define strcasecmp _stricmp #endif const char *features[] = {