summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47a1228)
raw | patch | inline | side by side (parent: 47a1228)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 7 Mar 2015 12:56:32 +0000 (13:56 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 7 Mar 2015 12:56:32 +0000 (13:56 +0100) |
src/core/data.c | patch | blob | history |
diff --git a/src/core/data.c b/src/core/data.c
index d34a4dd711250041cd26d463575535bd70522f4a..9f2b506fbc1b76e66dd330be7879655a530871ba 100644 (file)
--- a/src/core/data.c
+++ b/src/core/data.c
if (! datum)
return 0;
- if (datum->type == SDB_TYPE_INTEGER) {
+ if (sdb_data_isnull(datum)) {
+ /* NULL */
+ return 4;
+ }
+ else if (datum->type == SDB_TYPE_INTEGER) {
/* log(64) */
return 20;
}
if ((! datum) || (! buf) || (! buflen))
return -1;
- if (datum->type == SDB_TYPE_INTEGER) {
+ if (datum->type == SDB_TYPE_NULL) {
+ strncpy(buf, "NULL", buflen);
+ ret = 4;
+ }
+ else if (datum->type == SDB_TYPE_INTEGER) {
ret = snprintf(buf, buflen, "%"PRIi64, datum->data.integer);
}
else if (datum->type == SDB_TYPE_DECIMAL) {