1 --- a/src/naemon/xodtemplate.c 2019-07-03 18:34:13.795379190 +0200
2 +++ b/src/naemon/xodtemplate.c 2019-07-03 18:33:37.079085158 +0200
4 } else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
5 temp_host->flap_detection_options = OPT_ALL;
7 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid flap detection option '%s' in host definition.\n", temp_ptr);
8 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid flap detection option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
13 } else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
14 temp_host->notification_options = OPT_ALL;
16 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid notification option '%s' in host definition.\n", temp_ptr);
17 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid notification option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
22 } else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
23 temp_host->stalking_options = OPT_ALL;
25 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid stalking option '%s' in host definition.\n", temp_ptr);
26 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid stalking option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
30 @@ -7549,29 +7549,29 @@
31 xodtemplate_obsoleted(variable, temp_host->_start_line);
32 } else if (!strcmp(variable, "2d_coords")) {
33 if ((temp_ptr = strtok(value, ", ")) == NULL) {
34 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", temp_ptr);
35 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
38 temp_host->x_2d = atoi(temp_ptr);
39 if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
40 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", temp_ptr);
41 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
44 temp_host->y_2d = atoi(temp_ptr);
45 temp_host->have_2d_coords = TRUE;
46 } else if (!strcmp(variable, "3d_coords")) {
47 if ((temp_ptr = strtok(value, ", ")) == NULL) {
48 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
49 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
52 temp_host->x_3d = strtod(temp_ptr, NULL);
53 if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
54 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
55 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
58 temp_host->y_3d = strtod(temp_ptr, NULL);
59 if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
60 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
61 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
64 temp_host->z_3d = strtod(temp_ptr, NULL);
65 @@ -8176,13 +8176,13 @@
66 } else if (!strcmp(variable, "2d_coords")) {
67 temp_ptr = strtok(value, ", ");
68 if (temp_ptr == NULL) {
69 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", temp_ptr);
70 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
73 temp_hostextinfo->x_2d = atoi(temp_ptr);
74 temp_ptr = strtok(NULL, ", ");
75 if (temp_ptr == NULL) {
76 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", temp_ptr);
77 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
80 temp_hostextinfo->y_2d = atoi(temp_ptr);
81 @@ -8190,19 +8190,19 @@
82 } else if (!strcmp(variable, "3d_coords")) {
83 temp_ptr = strtok(value, ", ");
84 if (temp_ptr == NULL) {
85 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
86 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
89 temp_hostextinfo->x_3d = strtod(temp_ptr, NULL);
90 temp_ptr = strtok(NULL, ", ");
91 if (temp_ptr == NULL) {
92 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
93 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
96 temp_hostextinfo->y_3d = strtod(temp_ptr, NULL);
97 temp_ptr = strtok(NULL, ", ");
98 if (temp_ptr == NULL) {
99 - nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
100 + nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
103 temp_hostextinfo->z_3d = strtod(temp_ptr, NULL);
104 @@ -8369,21 +8369,21 @@
106 /* make sure an object type is specified... */
107 if (input[0] == '\x0') {
108 - nm_log(NSLOG_CONFIG_ERROR, "Error: No object type specified in file '%s' on line %d.\n", filename, current_line);
109 + nm_log(NSLOG_CONFIG_ERROR, "Error: No object type specified in file '%s' on line %d.\n", filename, (current_line ? current_line : -1));
114 /* we're already in an object definition... */
115 if (in_definition == TRUE) {
116 - nm_log(NSLOG_CONFIG_ERROR, "Error: Unexpected start of object definition in file '%s' on line %d. Make sure you close preceding objects before starting a new one.\n", filename, current_line);
117 + nm_log(NSLOG_CONFIG_ERROR, "Error: Unexpected start of object definition in file '%s' on line %d. Make sure you close preceding objects before starting a new one.\n", filename, (current_line ? current_line : -1));
122 /* start a new definition */
123 if (xodtemplate_begin_object_definition(input, xodtemplate_current_config_file, current_line) == ERROR) {
124 - nm_log(NSLOG_CONFIG_ERROR, "Error: Could not add object definition in file '%s' on line %d.\n", filename, current_line);
125 + nm_log(NSLOG_CONFIG_ERROR, "Error: Could not add object definition in file '%s' on line %d.\n", filename, (current_line ? current_line : -1));
129 @@ -8401,7 +8401,7 @@
131 /* close out current definition */
132 if (xodtemplate_end_object_definition() == ERROR) {
133 - nm_log(NSLOG_CONFIG_ERROR, "Error: Could not complete object definition in file '%s' on line %d. Have you named all your objects?\n", filename, current_line);
134 + nm_log(NSLOG_CONFIG_ERROR, "Error: Could not complete object definition in file '%s' on line %d. Have you named all your objects?\n", filename, (current_line ? current_line : -1));