diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-09-18 22:58:34 +0200 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-09-18 22:58:34 +0200 |
commit | ce355c80cf6054bfa5e1dcf81f9e2183ef963ee1 (patch) | |
tree | 199d6dbb3f14dd5afa20a9ca929bcdf8bb6a2982 /plugins | |
parent | c405dbafccd27259bd860ea408b32f2594e1a384 (diff) | |
download | monitoring-plugins-ce355c80cf6054bfa5e1dcf81f9e2183ef963ee1.tar.gz |
Initialize slaveresult to 0 and use strncat instead of bsd strlcat
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_mysql.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index 8dc554f1..9b7d13f3 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
@@ -110,7 +110,7 @@ main (int argc, char **argv) | |||
110 | 110 | ||
111 | char *result = NULL; | 111 | char *result = NULL; |
112 | char *error = NULL; | 112 | char *error = NULL; |
113 | char slaveresult[SLAVERESULTSIZE]; | 113 | char slaveresult[SLAVERESULTSIZE] = { 0 }; |
114 | char* perf; | 114 | char* perf; |
115 | 115 | ||
116 | perf = strdup (""); | 116 | perf = strdup (""); |
@@ -299,7 +299,7 @@ main (int argc, char **argv) | |||
299 | if (mysqldump_threads == 0) { | 299 | if (mysqldump_threads == 0) { |
300 | die (STATE_CRITICAL, "%s\n", slaveresult); | 300 | die (STATE_CRITICAL, "%s\n", slaveresult); |
301 | } else { | 301 | } else { |
302 | strlcat (slaveresult, " Mysqldump: in progress", SLAVERESULTSIZE); | 302 | strncat(slaveresult, " Mysqldump: in progress", SLAVERESULTSIZE-1); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||