summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/loader.c3
-rw-r--r--tests/library/test_loader.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/library/loader.c b/src/library/loader.c
index 3e58e0f..77abf18 100644
--- a/src/library/loader.c
+++ b/src/library/loader.c
@@ -86,8 +86,9 @@ wolf_error_t wolf_library_unload( wolf_library_p l ) {
char *wolf_libary_errmsg( const wolf_error_t error, const wolf_library_p l, char *buf, size_t buflen ) {
(void)wolf_error_msg( error, buf, buflen );
+ strncat( buf, " - ", buflen - strlen( buf ) );
if( error == WOLF_ERR_INTERNAL ) {
- strncpy( buf + strlen( buf ), l->errbuf, buflen - strlen( buf ) );
+ strncat( buf, l->errbuf, buflen - strlen( buf ) );
}
return buf;
diff --git a/tests/library/test_loader.c b/tests/library/test_loader.c
index f6f78dd..46d2ad0 100644
--- a/tests/library/test_loader.c
+++ b/tests/library/test_loader.c
@@ -27,8 +27,8 @@ int main( void ) {
library = wolf_library_load( "testlib.so", &error );
if( error != WOLF_OK ) {
- fprintf( stderr, "Error loading the library: %s (%d)\n",
- wolf_libary_errmsg( error, library, errbuf, 512 ), error );
+ fprintf( stderr, "Error %d loading the library: %s\n",
+ error, wolf_libary_errmsg( error, library, errbuf, 512 ) );
return EXIT_FAILURE;
}