diff options
| -rw-r--r-- | src/blob.h | 1 | ||||
| -rw-r--r-- | src/squark-auth-ip.c | 2 | 
2 files changed, 2 insertions, 1 deletions
@@ -31,6 +31,7 @@ typedef struct blob {  #define BLOB_STRLEN(str)	(blob_t){(str), strlen(str)}  #define BLOB_STR_INIT(str)	{(str), sizeof(str)-1}  #define BLOB_STR(str)		(blob_t) BLOB_STR_INIT(str) +#define BLOB_CHAR_ARRAY(a) (blob_t){(a), strnlen(a, sizeof(a))}  #define BLOB_NULL		(blob_t){NULL, 0}  static inline int blob_is_null(blob_t b) diff --git a/src/squark-auth-ip.c b/src/squark-auth-ip.c index baf0b4b..94c450f 100644 --- a/src/squark-auth-ip.c +++ b/src/squark-auth-ip.c @@ -228,7 +228,7 @@ int main(int argc, char **argv)  			DUMPPAR(&b, "ip_address",  				addr_push_hostaddr(&b, &ipaddr));  			DUMPPAR(&b, "username", -				blob_push(&b, BLOB_BUF(entry.p.login_name))); +				blob_push(&b, BLOB_CHAR_ARRAY(entry.p.login_name)));  			DUMPPAR(&b, "mac_address",  				blob_push_hexdump(&b, BLOB_BUF(entry.p.mac_address)));  			DUMPPAR(&b, "login_time",  | 
