Explicit conversions and minor changes to prevent MSVC compiler warnings
diff --git a/library/error.c b/library/error.c
index 47bfcc4..ff6fb07 100644
--- a/library/error.c
+++ b/library/error.c
@@ -169,8 +169,13 @@
     size_t len;
     int use_ret;
 
+    if( buflen == 0 )
+        return;
+
     memset( buf, 0x00, buflen );
-     
+    /* Reduce buflen to make sure MSVC _snprintf() ends with \0 as well */
+    buflen -= 1;
+
     if( ret < 0 )
         ret = -ret;