diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-09-14 13:06:29 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2010-09-14 13:22:08 +0300 |
commit | 4be1e8fd5e352a54e87a81979d5ad303efdcbffe (patch) | |
tree | 1a1271bea793e3914e1e2b6846db251186313ddb /blob.c | |
parent | 36a24c1ffd961b263e392d8167fa4799865c08f6 (diff) | |
download | squark-4be1e8fd5e352a54e87a81979d5ad303efdcbffe.tar.bz2 squark-4be1e8fd5e352a54e87a81979d5ad303efdcbffe.tar.xz |
auth-ip: print information in shell compatible format
so we can dump information from http cgi-bin scripts.
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; |