X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_thread_safe_nt.c;h=eee5543a01c016953f2ccda94f0f52baa5c11e68;hb=5fe8a76ab35012a0a5e1bd8cc5ff4a6f059f37f5;hp=dba1c3e0b7a16b2443be6c3fd5a5b797a8021171;hpb=daf8e7ff715a59e1f9827080d1b785ffb3c5a4b1;p=rrdtool.git diff --git a/src/rrd_thread_safe_nt.c b/src/rrd_thread_safe_nt.c index dba1c3e..eee5543 100644 --- a/src/rrd_thread_safe_nt.c +++ b/src/rrd_thread_safe_nt.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3rc7 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.2 Copyright by Tobi Oetiker, 1997-2008 * This file: Copyright 2003 Peter Stamfest * & Tobias Oetiker * Distributed under the GPL @@ -44,10 +44,10 @@ static void context_init_context( atexit(context_destroy_context); } } -struct rrd_context *rrd_get_context( +rrd_context_t *rrd_get_context( void) { - struct rrd_context *ctx; + rrd_context_t *ctx; context_init_context(); @@ -63,15 +63,15 @@ struct rrd_context *rrd_get_context( const char *rrd_strerror( int err) { - struct rrd_context *ctx; + rrd_context_t *ctx; context_init_context(); 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;