X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_thread_safe_nt.c;h=eee5543a01c016953f2ccda94f0f52baa5c11e68;hb=caa9411848390bf066b02588c4525731bee190c5;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..eee5543 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.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;