diff options
Diffstat (limited to 'blob.c')
-rw-r--r-- | blob.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |