Explicit conversions and minor changes to prevent MSVC compiler warnings
diff --git a/scripts/data_files/error.fmt b/scripts/data_files/error.fmt
index 789f182..61f63cf 100644
--- a/scripts/data_files/error.fmt
+++ b/scripts/data_files/error.fmt
@@ -42,8 +42,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;