X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_thread_safe_nt.c;h=105507f2747160f052f1d7f357d6d487018c1ded;hp=8f68ea395b853a047ba2b1fd2fd6133c6646abca;hb=12408853ccdabd7d2aff1b86dc848a2755391bd2;hpb=b244c918dd034a4951e2318140b1d4ef132b6657 diff --git a/src/rrd_thread_safe_nt.c b/src/rrd_thread_safe_nt.c index 8f68ea3..105507f 100644 --- a/src/rrd_thread_safe_nt.c +++ b/src/rrd_thread_safe_nt.c @@ -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; }