summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-05-10 00:36:32 +0200
committerChristian Grothoff <christian@grothoff.org>2023-05-10 00:36:32 +0200
commitc863193d77f74378a321908eed7105eb3034977b (patch)
tree01fb4f25f8bdc24576727309155b469afe85ddea
parentd50dd8c4f267095c08b9f600f5389bb77de13a49 (diff)
no 0-length VLAs
-rw-r--r--src/pq/pq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pq/pq.c b/src/pq/pq.c
index c8deb8193..aa852902a 100644
--- a/src/pq/pq.c
+++ b/src/pq/pq.c
@@ -47,11 +47,11 @@ GNUNET_PQ_exec_prepared (struct GNUNET_PQ_Context *db,
/* new scope to allow stack allocation without alloca */
{
/* Scratch buffer for temporary storage */
- void *scratch[len];
+ void *scratch[GNUNET_NZL (len)];
/* Parameter array we are building for the query */
- void *param_values[len];
- int param_lengths[len];
- int param_formats[len];
+ void *param_values[GNUNET_NZL (len)];
+ int param_lengths[GNUNET_NZL (len)];
+ int param_formats[GNUNET_NZL (len)];
unsigned int off;
/* How many entries in the scratch buffer are in use? */
unsigned int soff;
@@ -178,7 +178,7 @@ GNUNET_PQ_extract_result (PGresult *result,
*spec->result_size = spec->dst_size;
}
return GNUNET_OK;
-cleanup:
+ cleanup:
for (unsigned int j = 0; j < i; j++)
if (NULL != rs[j].cleaner)
rs[j].cleaner (rs[j].cls,