From: Florian Forster Date: Thu, 23 Apr 2009 07:35:46 +0000 (+0200) Subject: mysql plugin: Use `strlen ("Table_locks_")' rather than `12'. X-Git-Tag: collectd-4.7.0~33 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d04c883b1114f903022e8d772bc2c21db9af329a;p=collectd.git mysql plugin: Use `strlen ("Table_locks_")' rather than `12'. --- diff --git a/src/mysql.c b/src/mysql.c index ca364b6c..b700ff02 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -794,12 +794,12 @@ static int mysql_read (user_data_t *ud) else if (strcmp (key, "Threads_created") == 0) threads_created = val; } - else if (strncmp (key, "Table_locks_", 12) == 0) + else if (strncmp (key, "Table_locks_", + strlen ("Table_locks_")) == 0) { - if (val == 0ULL) - continue; - - counter_submit ("mysql_locks", key + 12, val, db); + counter_submit ("mysql_locks", + key + strlen ("Table_locks_"), + val, db); } } mysql_free_result (res); res = NULL;