projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for debian bug 498183 ... never *advise after the end of the
[rrdtool.git]
/
src
/
rrd_thread_safe_nt.c
diff --git
a/src/rrd_thread_safe_nt.c
b/src/rrd_thread_safe_nt.c
index
4786f2c
..
eee5543
100644
(file)
--- a/
src/rrd_thread_safe_nt.c
+++ b/
src/rrd_thread_safe_nt.c
@@
-1,5
+1,5
@@
/*****************************************************************************
/*****************************************************************************
- * RRDtool 1.
2.23 Copyright by Tobi Oetiker, 1997-2007
+ * RRDtool 1.
3.2 Copyright by Tobi Oetiker, 1997-2008
* This file: Copyright 2003 Peter Stamfest <peter@stamfest.at>
* & Tobias Oetiker
* Distributed under the GPL
* This file: Copyright 2003 Peter Stamfest <peter@stamfest.at>
* & Tobias Oetiker
* Distributed under the GPL
@@
-44,10
+44,10
@@
static void context_init_context(
atexit(context_destroy_context);
}
}
atexit(context_destroy_context);
}
}
-
struct rrd_contex
t *rrd_get_context(
+
rrd_context_
t *rrd_get_context(
void)
{
void)
{
-
struct rrd_contex
t *ctx;
+
rrd_context_
t *ctx;
context_init_context();
context_init_context();
@@
-63,15
+63,15
@@
struct rrd_context *rrd_get_context(
const char *rrd_strerror(
int err)
{
const char *rrd_strerror(
int err)
{
-
struct rrd_contex
t *ctx;
+
rrd_context_
t *ctx;
context_init_context();
ctx = rrd_get_context();
EnterCriticalSection(&CriticalSection);
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;
LeaveCriticalSection(&CriticalSection);
return ctx->lib_errstr;