aboutsummaryrefslogtreecommitdiff
path: root/src/pq/pq_query_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pq/pq_query_helper.c')
-rw-r--r--src/pq/pq_query_helper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index 1f13270c3..1a31333d9 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -782,6 +782,7 @@ qconv_array (
782 { 782 {
783 char *in = (char *) data; 783 char *in = (char *) data;
784 char *out = elements; 784 char *out = elements;
785 size_t nullbyte = (array_of_string == meta->typ) ? 1 : 0;
785 struct pq_array_header h = { 786 struct pq_array_header h = {
786 .ndim = htonl (1), /* We only support one-dimensional arrays */ 787 .ndim = htonl (1), /* We only support one-dimensional arrays */
787 .has_null = htonl (0), /* We do not support NULL entries in arrays */ 788 .has_null = htonl (0), /* We do not support NULL entries in arrays */
@@ -794,6 +795,7 @@ qconv_array (
794 GNUNET_memcpy (out, &h, sizeof(h)); 795 GNUNET_memcpy (out, &h, sizeof(h));
795 out += sizeof(h); 796 out += sizeof(h);
796 797
798
797 /* Write elements */ 799 /* Write elements */
798 for (unsigned int i = 0; i < num; i++) 800 for (unsigned int i = 0; i < num; i++)
799 { 801 {
@@ -840,9 +842,7 @@ qconv_array (
840 if (meta->continuous) 842 if (meta->continuous)
841 { 843 {
842 ptr = in; 844 ptr = in;
843 in += sz; 845 in += sz + nullbyte;
844 if (array_of_string == meta->typ)
845 in += 1; /* NULL-byte */
846 } 846 }
847 else 847 else
848 ptr = ((const void **) data)[i]; 848 ptr = ((const void **) data)[i];
@@ -933,7 +933,7 @@ qconv_array (
933 param_formats[0] = 1; 933 param_formats[0] = 1;
934 scratch[0] = elements; 934 scratch[0] = elements;
935 935
936 DONE: 936DONE:
937 GNUNET_free (string_lengths); 937 GNUNET_free (string_lengths);
938 938
939 if (noerror) 939 if (noerror)