summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00e6382)
raw | patch | inline | side by side (parent: 00e6382)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 9 Feb 2004 08:27:54 +0000 (08:27 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 9 Feb 2004 08:27:54 +0000 (08:27 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@799 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_ping.c | patch | blob | history |
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index ab5e0cc327271d57446e703a0e9be96b7c869798..1d34656cf6a79145f5d15d7317ac90c96cc919d4 100644 (file)
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- addresses = malloc ((size_t)max_addr);
+ addresses = malloc (sizeof(char*) * max_addr);
+ addresses[0] = NULL;
if (process_arguments (argc, argv) == ERROR)
usage (_("Could not parse arguments"));
n_addresses++;
if (n_addresses > max_addr) {
max_addr *= 2;
- addresses = realloc (addresses, (size_t)max_addr);
+ addresses = realloc (addresses, sizeof(char*) * max_addr);
if (addresses == NULL)
die (STATE_UNKNOWN, _("Could not realloc() addresses\n"));
}
return ERROR;
} else {
addresses[0] = argv[c++];
+ n_addresses++;
if (c == argc)
return validate_arguments ();
}