summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Mueller <dmueller@suse.com>2026-02-16 11:27:49 +0100
committerGitHub <noreply@github.com>2026-02-16 11:27:49 +0100
commit15b9a39b6085f9382e1907ef769a50aee716e839 (patch)
tree1d7d852a3ca5bcbf7801b1629b530fe7112e7f74
parent07a249a5d74a980ca78cead569de5351963cc561 (diff)
downloadmonitoring-plugins-15b9a39b6085f9382e1907ef769a50aee716e839.tar.gz
Make replacing of mismatching single quotes work (#2232)HEADmaster
Fixes a logic error in the string handling that led to dead code before.
-rw-r--r--lib/perfdata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/perfdata.c b/lib/perfdata.c
index 138df53b..f4eaf843 100644
--- a/lib/perfdata.c
+++ b/lib/perfdata.c
@@ -39,7 +39,7 @@ char *pd_to_string(mp_perfdata pd) {
39 } else { 39 } else {
40 // we have an illegal single quote in the string 40 // we have an illegal single quote in the string
41 // replace it silently instead of complaining 41 // replace it silently instead of complaining
42 for (char *ptr = pd.label; *ptr == '\0'; ptr++) { 42 for (char *ptr = pd.label; *ptr != '\0'; ptr++) {
43 if (*ptr == '\'') { 43 if (*ptr == '\'') {
44 *ptr = '_'; 44 *ptr = '_';
45 } 45 }