X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnginx.c;h=2de3633b41c6ffdc2feb1ffc64d329bca7092f9b;hb=f50ada19dcd0dc6185dc4b410e721d46d1caba9f;hp=dfa4f9832f0252acdfe789d5effc7e560ebcaa4c;hpb=b72d521340383b6418fa6a75faca3bc45f06b14a;p=collectd.git diff --git a/src/nginx.c b/src/nginx.c index dfa4f983..2de3633b 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -123,8 +123,9 @@ static int init (void) if (user != NULL) { - if (ssnprintf (credentials, sizeof (credentials), - "%s:%s", user, pass == NULL ? "" : pass) >= sizeof (credentials)) + int status = ssnprintf (credentials, sizeof (credentials), + "%s:%s", user, pass == NULL ? "" : pass); + if ((status < 0) || ((size_t) status >= sizeof (credentials))) { ERROR ("nginx plugin: Credentials would have been truncated."); return (-1);