Fixed NULL writing

Mon, 07 Jul 2014 22:51:59 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 07 Jul 2014 22:51:59 +0200
changeset 96
d08bf980ff28
parent 95
2c28afc329a5
child 97
4a9dbee41a6c

Fixed NULL writing

thermferm/rdconfig.c file | annotate | diff | comparison | revisions
--- a/thermferm/rdconfig.c	Mon Jul 07 22:31:07 2014 +0200
+++ b/thermferm/rdconfig.c	Mon Jul 07 22:51:59 2014 +0200
@@ -173,7 +173,7 @@
 	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
-    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_ADDRESS", "%s", Config.air_address)) < 0) {
+    if (Config.air_address && (rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_ADDRESS", "%s", Config.air_address)) < 0) {
 	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }

mercurial