diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2021-12-02 14:11:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 14:11:21 (GMT) |
commit | df1e9e975f69c8f7965bab91684870fe509739c6 (patch) | |
tree | 526b0c77c524b2219d5a48fd78b8302f055a4a5b /plugins/check_pgsql.c | |
parent | 6246b8f1830e8a375bc656deafd28aab715b4fd9 (diff) | |
parent | 1a3a715702a5b6709fed2a1eb53ec644c9968057 (diff) | |
download | monitoring-plugins-df1e9e975f69c8f7965bab91684870fe509739c6.tar.gz |
Merge branch 'master' into mailq-add-config-dir
Diffstat (limited to 'plugins/check_pgsql.c')
-rw-r--r-- | plugins/check_pgsql.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 5cd4709..b8fc5f1 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
@@ -34,6 +34,7 @@ const char *email = "devel@monitoring-plugins.org"; | |||
34 | 34 | ||
35 | #include "common.h" | 35 | #include "common.h" |
36 | #include "utils.h" | 36 | #include "utils.h" |
37 | #include "utils_cmd.h" | ||
37 | 38 | ||
38 | #include "netutils.h" | 39 | #include "netutils.h" |
39 | #include <libpq-fe.h> | 40 | #include <libpq-fe.h> |
@@ -346,7 +347,7 @@ process_arguments (int argc, char **argv) | |||
346 | if (!is_pg_dbname (optarg)) /* checks length and valid chars */ | 347 | if (!is_pg_dbname (optarg)) /* checks length and valid chars */ |
347 | usage2 (_("Database name is not valid"), optarg); | 348 | usage2 (_("Database name is not valid"), optarg); |
348 | else /* we know length, and know optarg is terminated, so us strcpy */ | 349 | else /* we know length, and know optarg is terminated, so us strcpy */ |
349 | strcpy (dbName, optarg); | 350 | snprintf(dbName, NAMEDATALEN, "%s", optarg); |
350 | break; | 351 | break; |
351 | case 'l': /* login name */ | 352 | case 'l': /* login name */ |
352 | if (!is_pg_logname (optarg)) | 353 | if (!is_pg_logname (optarg)) |