do not stop at null byte 0x00; replace them with '@' II v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 23 Apr 2022 11:31:30 +0200
branchv_0
changeset 24 d698d34baf9b
parent 23 b717a552e63f
child 25 58de33c1af03
do not stop at null byte 0x00; replace them with '@' II
src/NullByteHandler.h
--- a/src/NullByteHandler.h	Sat Apr 23 11:29:21 2022 +0200
+++ b/src/NullByteHandler.h	Sat Apr 23 11:31:30 2022 +0200
@@ -52,7 +52,10 @@
 
 	void attribute(const string_t& value) override {
 		const std::string octets = convertor.to_bytes(value);
-		for (char ch : octets) output.put(ch ? ch : '@');
+		for (char ch : octets) {
+			if (ch) output.put(ch);
+			else output.put('@'); // TODO: configurable replacement, maybe a string instead of a single char
+		}
 		output.put(0);
 	}