summaryrefslogtreecommitdiff
path: root/lib/util/data_blob.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/data_blob.c')
-rw-r--r--lib/util/data_blob.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/util/data_blob.c b/lib/util/data_blob.c
index 1b2f05528b..c7d01bacc7 100644
--- a/lib/util/data_blob.c
+++ b/lib/util/data_blob.c
@@ -183,6 +183,18 @@ _PUBLIC_ DATA_BLOB data_blob_string_const(const char *str)
}
/**
+ useful for constructing data blobs in test suites, while
+ avoiding const warnings
+**/
+_PUBLIC_ DATA_BLOB data_blob_string_const_null(const char *str)
+{
+ DATA_BLOB blob;
+ blob.data = discard_const_p(uint8_t, str);
+ blob.length = str ? strlen(str)+1 : 0;
+ return blob;
+}
+
+/**
* Create a new data blob from const data
*/