X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_thread_safe_nt.c;h=899fe93db44cd5c0b8bada2537ab3a1962bfa187;hb=46d2e915a9f864304ee107f9ea35a60b01d3e378;hp=2598166446c0b5b94f6cb47578f8230770a09267;hpb=b894ebf96ca888b9e3e13b2ab86a6c6f284b757c;p=rrdtool.git diff --git a/src/rrd_thread_safe_nt.c b/src/rrd_thread_safe_nt.c index 2598166..899fe93 100644 --- a/src/rrd_thread_safe_nt.c +++ b/src/rrd_thread_safe_nt.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3rc5 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3rc7 Copyright by Tobi Oetiker, 1997-2008 * This file: Copyright 2003 Peter Stamfest * & Tobias Oetiker * Distributed under the GPL @@ -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;