X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_thread_safe.c;h=bccea99fba2f8508672bc5c8430152405e8c0024;hp=c06da050faaa13b977293eb10ba910a2153be21e;hb=12408853ccdabd7d2aff1b86dc848a2755391bd2;hpb=b244c918dd034a4951e2318140b1d4ef132b6657 diff --git a/src/rrd_thread_safe.c b/src/rrd_thread_safe.c index c06da05..bccea99 100644 --- a/src/rrd_thread_safe.c +++ b/src/rrd_thread_safe.c @@ -61,6 +61,7 @@ const char *rrd_strerror(int err) { ctx = rrd_get_context(); pthread_mutex_lock(&mtx); strncpy(ctx->lib_errstr, strerror(err), ctx->errlen); + ctx->lib_errstr[ctx->errlen]='\0'; pthread_mutex_unlock(&mtx); return ctx->lib_errstr; }