diff options
author | baumann <baumann@netbsd50264.eurospider.ch> | 2010-05-21 16:54:32 +0200 |
---|---|---|
committer | baumann <baumann@netbsd50264.eurospider.ch> | 2010-05-21 16:54:32 +0200 |
commit | 223b524f4636be7aa030f8609125d54cd9ea0882 (patch) | |
tree | dfa2a7c992b8b9e9e90a5aa0036f8473681be6d1 /src | |
parent | 9a87f992d39fd2bb27065a722132bba7842a39d2 (diff) | |
download | wolfbones-223b524f4636be7aa030f8609125d54cd9ea0882.tar.gz wolfbones-223b524f4636be7aa030f8609125d54cd9ea0882.tar.bz2 |
fixed on NetBSD 5.0.2 (64-bit)
fixed wrong usage of snprintf in errors.c
Diffstat (limited to 'src')
-rw-r--r-- | src/errors.c | 20 | ||||
-rw-r--r-- | src/port/sys_internal.h | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/errors.c b/src/errors.c index 08e94f6..5de1c6b 100644 --- a/src/errors.c +++ b/src/errors.c @@ -18,44 +18,44 @@ #include "errors.h" #include "port/gettext.h" /* for localization */ -#include "port/stdio.h" /* for snprintf */ +#include "port/string.h" /* for strncpy */ char *wolf_error_msg( const wolf_error_t error, char *buf, size_t buflen ) { switch( error ) { case WOLF_OK: - snprintf( buf, buflen, _( "No error" ) ); + strncpy( buf, _( "No error" ), buflen ); break; case WOLF_ERR_OUT_OF_MEMORY: - snprintf( buf, buflen, _( "Out of memory" ) ); + strncpy( buf, _( "Out of memory" ), buflen ); break; case WOLF_ERR_INVALID_STATE: - snprintf( buf, buflen, _( "Invalid state" ) ); + strncpy( buf, _( "Invalid state" ), buflen ); break; case WOLF_ERR_INVALID_VALUE: - snprintf( buf, buflen, _( "Invalid value" ) ); + strncpy( buf, _( "Invalid value" ), buflen ); break; case WOLF_ERR_INTERNAL: - snprintf( buf, buflen, _( "Internal error" ) ); + strncpy( buf, _( "Internal error" ), buflen ); break; case WOLF_ERR_PROGRAMMING: - snprintf( buf, buflen, _( "Programming error" ) ); + strncpy( buf, _( "Programming error" ), buflen ); break; case WOLF_ERR_NOT_IMPLEMENTED: - snprintf( buf, buflen, _( "Not implemented" ) ); + strncpy( buf, _( "Not implemented" ), buflen ); break; case WOLF_ERR_TIMEOUT: - snprintf( buf, buflen, _( "Timeout" ) ); + strncpy( buf, _( "Timeout" ), buflen ); break; default: - snprintf( buf, buflen, _( "<unknown error>" ) ); + strncpy( buf, _( "<unknown error>" ), buflen ); } return buf; diff --git a/src/port/sys_internal.h b/src/port/sys_internal.h index 0dae35d..e7aa27e 100644 --- a/src/port/sys_internal.h +++ b/src/port/sys_internal.h @@ -87,6 +87,7 @@ #if OS_MINOR_VERSION == 0 #define HAVE_LOCK_F #define HAVE_LOCALTIME_R +#define HAVE_DLFCN #else #error unknown platform #endif /* defined OS_MINOR_VERSION == 2 */ @@ -95,6 +96,7 @@ #if OS_MINOR_VERSION == 0 #define HAVE_LOCK_F #define HAVE_LOCALTIME_R +#define HAVE_DLFCN #else #error unknown platform #endif /* defined OS_MINOR_VERSION == 0 */ |