summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d96909)
raw | patch | inline | side by side (parent: 0d96909)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 10 Feb 2014 18:10:52 +0000 (19:10 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 10 Feb 2014 18:10:52 +0000 (19:10 +0100) |
src/core/data.c | patch | blob | history | |
t/core/data_test.c | patch | blob | history |
diff --git a/src/core/data.c b/src/core/data.c
index 8f4330eabccf173a2ddca0b6721dab2594295f70..735639dcc450f2761dbf0179a70a27d7de784c81 100644 (file)
--- a/src/core/data.c
+++ b/src/core/data.c
'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];
diff --git a/t/core/data_test.c b/t/core/data_test.c
index fb3b1145bac8001458b95b598a348c92dc15ca20..e4ead2fe12711484bd5f5c4a42d46076e989c29f 100644 (file)
--- a/t/core/data_test.c
+++ b/t/core/data_test.c
fail_unless(! check,
"sdb_data_format(BINARY) = %d; expected: 0", check);
string = sdb_strbuf_string(buf);
- expected = "\"\\62\\69\\6e\\61\\72\\79\\0\\63\\72\\61\\70\\42\"";
+ expected =
+ "\"\\x62\\x69\\x6e\\x61\\x72\\x79\\x0\\x63\\x72\\x61\\x70\\x42\"";
fail_unless(! strcmp(string, expected),
"sdb_data_format() used wrong format: %s; expected: %s",
string, expected);