[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 01/04: allow use of NULL for stirings
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 01/04: allow use of NULL for stirings |
Date: |
Tue, 14 Mar 2017 00:31:05 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 75c1a7d1310c1baa452e99fe3968939b9edfab53
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Mar 13 20:08:52 2017 +0100
allow use of NULL for stirings
---
src/sq/sq_query_helper.c | 8 ++++++++
src/sq/sq_result_helper.c | 7 +++++++
2 files changed, 15 insertions(+)
diff --git a/src/sq/sq_query_helper.c b/src/sq/sq_query_helper.c
index a04b4ced4..94a3a3f1c 100644
--- a/src/sq/sq_query_helper.c
+++ b/src/sq/sq_query_helper.c
@@ -90,6 +90,14 @@ bind_string (void *cls,
sqlite3_stmt *stmt,
unsigned int off)
{
+ if (NULL == data)
+ {
+ if (SQLITE_OK !=
+ sqlite3_bind_null (stmt,
+ (int) off))
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
+ }
if (SQLITE_OK !=
sqlite3_bind_text (stmt,
(int) off,
diff --git a/src/sq/sq_result_helper.c b/src/sq/sq_result_helper.c
index fad3f3c8d..9579863b2 100644
--- a/src/sq/sq_result_helper.c
+++ b/src/sq/sq_result_helper.c
@@ -228,6 +228,13 @@ extract_utf8_string (void *cls,
const char *text;
char **rdst = dst;
+ if (SQLITE_NULL ==
+ sqlite3_column_type (result,
+ column))
+ {
+ *rdst = NULL;
+ return GNUNET_OK;
+ }
if (SQLITE_TEXT !=
sqlite3_column_type (result,
column))
--
To stop receiving notification emails like this one, please contact
address@hidden