X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_thread_safe_nt.c;h=12fb75a5a7839fa66463736d66c01e1d9440aad2;hp=15791bb2687cd09ee04e10a1d2db4e2ae1c879d7;hb=35354e059a77479a7a135c1e4fc71c76523fd7c4;hpb=7383625ce0413ce5dbcc0ced4ee4873c6df37735 diff --git a/src/rrd_thread_safe_nt.c b/src/rrd_thread_safe_nt.c index 15791bb..12fb75a 100644 --- a/src/rrd_thread_safe_nt.c +++ b/src/rrd_thread_safe_nt.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.99907080300 Copyright by Tobi Oetiker, 1997-2007 + * RRDtool 1.3.0 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;