From: Saulius Grigaliunas Date: Thu, 13 Dec 2007 06:58:51 +0000 (+0100) Subject: nginx plugin: Use strcmp rather than strcpy to compare strings. X-Git-Tag: collectd-4.2.2~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=21d3ac6f9cfee60d261cda30b6ec71b3c496f8b7;p=collectd.git nginx plugin: Use strcmp rather than strcpy to compare strings. I believe I found a typo in nginx.c which prevents collectd with nginx plugin from working. Collectd segfaults at startup. Here is a tiny patch to correct the issue. When applied, everything works as expected. Signed-off-by: Florian Forster --- diff --git a/src/nginx.c b/src/nginx.c index 69dc49e2..a44e8a57 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -141,9 +141,9 @@ static void submit (char *type, char *inst, long long value) value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - if (strcpy (type, "nginx_connections") == 0) + if (strcmp (type, "nginx_connections") == 0) values[0].gauge = value; - else if (strcpy (type, "nginx_requests") == 0) + else if (strcmp (type, "nginx_requests") == 0) values[0].counter = value; else return;