Code

data: Format binary bytes as \xXX rather than \XX.
[sysdb.git] / src / core / data.c
index 8f4330eabccf173a2ddca0b6721dab2594295f70..735639dcc450f2761dbf0179a70a27d7de784c81 100644 (file)
@@ -124,7 +124,8 @@ sdb_data_format(sdb_data_t *datum, sdb_strbuf_t *buf)
                                                '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
 
                                        tmp[pos] = '\\';
-                                       ++pos;
+                                       tmp[pos + 1] = 'x';
+                                       pos += 2;
 
                                        if (byte > 0xf) {
                                                tmp[pos] = hex[byte >> 4];