summaryrefslogtreecommitdiffstats
path: root/blob.c
diff options
context:
space:
mode:
Diffstat (limited to 'blob.c')
-rw-r--r--blob.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/blob.c b/blob.c
index f2a80f6..2c5dd17 100644
--- a/blob.c
+++ b/blob.c
@@ -1,3 +1,4 @@
+#include <time.h>
#include <ctype.h>
#include <string.h>
@@ -208,6 +209,17 @@ void blob_push_uint(blob_t *to, unsigned int value, int radix)
blob_push(to, BLOB_PTR_PTR(ptr+1, &buf[sizeof(buf)-1]));
}
+void blob_push_ctime(blob_t *to, time_t t)
+{
+ char buf[128];
+ blob_t b;
+
+ ctime_r(&t, buf);
+ b = BLOB_STRLEN(buf);
+ b.len--;
+ blob_push(to, b);
+}
+
void blob_push_hexdump(blob_t *to, blob_t binary)
{
char *d;