disable pango markup by default. added --pango-markup option for explicit enablement.
[rrdtool.git] / src / rrd_thread_safe_nt.c
index dba1c3e..899fe93 100644 (file)
@@ -70,8 +70,8 @@ const char *rrd_strerror(
     ctx = rrd_get_context();
 
     EnterCriticalSection(&CriticalSection);
-    strncpy(ctx->lib_errstr, strerror(err), ctx->errlen);
-    ctx->lib_errstr[ctx->errlen] = '\0';
+    strncpy(ctx->lib_errstr, strerror(err), sizeof(ctx->lib_errstr));
+    ctx->lib_errstr[sizeof(ctx->lib_errstr) - 1] = '\0';
     LeaveCriticalSection(&CriticalSection);
 
     return ctx->lib_errstr;