Code

prepare for the release of rrdtool-1.2.29
[rrdtool-all.git] / program / src / rrd_thread_safe_nt.c
index eb19dcbb17805434fa2541aad88eb61ce83a5531..804808f1b327cc60e8a040b56f9e2539fa4f71c9 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.2rc3  Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.29  Copyright by Tobi Oetiker, 1997-2008
  * This file:     Copyright 2003 Peter Stamfest <peter@stamfest.at> 
  *                             & Tobias Oetiker
  * Distributed under the GPL
@@ -63,7 +63,8 @@ const char *rrd_strerror(int err) {
 
     EnterCriticalSection(&CriticalSection); 
     strncpy(ctx->lib_errstr, strerror(err), ctx->errlen);
-       LeaveCriticalSection(&CriticalSection); 
+    ctx->lib_errstr[ctx->errlen] = '\0';
+    LeaveCriticalSection(&CriticalSection); 
 
     return ctx->lib_errstr;
 }