[monitoring-plugins] Make replacing of mismatching single quotes work ...

GitHub git at monitoring-plugins.org
Mon Feb 16 11:30:13 CET 2026


    Module: monitoring-plugins
    Branch: master
    Commit: 15b9a39b6085f9382e1907ef769a50aee716e839
    Author: Dirk Mueller <dmueller at suse.com>
 Committer: GitHub <noreply at github.com>
      Date: Mon Feb 16 11:27:49 2026 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=15b9a39b

Make replacing of mismatching single quotes work (#2232)

Fixes a logic error in the string handling that led to dead code before.

---

 lib/perfdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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) {
 	} else {
 		// we have an illegal single quote in the string
 		// replace it silently instead of complaining
-		for (char *ptr = pd.label; *ptr == '\0'; ptr++) {
+		for (char *ptr = pd.label; *ptr != '\0'; ptr++) {
 			if (*ptr == '\'') {
 				*ptr = '_';
 			}



More information about the Commits mailing list