aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_nt.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_nt.c')
-rw-r--r--plugins/check_nt.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index cac826f5..1bdddc45 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -355,19 +355,18 @@ int main(int argc, char **argv){
if (allRight)
{
/* Let's format the output string, finally... */
-
if (strstr(description, "%") == NULL) {
- asprintf (&output_message, "%s = %.2f %s", description, counter_value, counter_unit);
+ asprintf (&output_message, "%s = %.2f %s", description, counter_value, counter_unit);
} else {
/* has formatting, will segv if wrong */
asprintf (&output_message, description, counter_value);
}
- output_message = strcat (output_message, "|");
- output_message = strcat (output_message,
- fperfdata (description, counter_value, counter_unit,
- 1, warning_value, 1, critical_value,
- (!(isPercent) && (minval != NULL)), fminval,
- (!(isPercent) && (minval != NULL)), fmaxval));
+ asprintf (&output_message, "%s |", output_message);
+ asprintf (&output_message,"%s %s", output_message,
+ fperfdata (description, counter_value,
+ counter_unit, 1, warning_value, 1, critical_value,
+ (!(isPercent) && (minval != NULL)), fminval,
+ (!(isPercent) && (minval != NULL)), fmaxval));
}
}