X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_thread_safe_nt.c;h=eee5543a01c016953f2ccda94f0f52baa5c11e68;hb=59525f3de81d5f6a9c5e5fc3a6662fa7e074163f;hp=4faa99591605cfc69eafaa408c86e0d1e0197e69;hpb=3c268443bb768669f3bd095b9e95a9a5ab4c5ef2;p=rrdtool.git diff --git a/src/rrd_thread_safe_nt.c b/src/rrd_thread_safe_nt.c index 4faa995..eee5543 100644 --- a/src/rrd_thread_safe_nt.c +++ b/src/rrd_thread_safe_nt.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3rc6 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;