fixed a logfmt bug

This commit is contained in:
hyung-hwan 2016-11-09 15:50:41 +00:00
parent ccca08c725
commit 66af1a8ea3
2 changed files with 4 additions and 3 deletions

View File

@ -192,7 +192,7 @@ static int is_normalized_integer (hcl_t* hcl, hcl_oop_t oop)
return 0; return 0;
} }
HCL_INLINE int is_bigint (hcl_t* hcl, hcl_oop_t x) HCL_INLINE static int is_bigint (hcl_t* hcl, hcl_oop_t x)
{ {
hcl_oop_t c; hcl_oop_t c;

View File

@ -217,7 +217,8 @@ redo:
} }
newcapa = HCL_ALIGN(hcl->log.len + len, 512); /* TODO: adjust this capacity */ newcapa = HCL_ALIGN(hcl->log.len + len, 512); /* TODO: adjust this capacity */
tmp = hcl_reallocmem (hcl, hcl->log.ptr, newcapa * HCL_SIZEOF(*tmp)); /* +1 to handle line ending injection more easily */
tmp = hcl_reallocmem (hcl, hcl->log.ptr, (newcapa + 1) * HCL_SIZEOF(*tmp));
if (!tmp) if (!tmp)
{ {
if (hcl->log.len > 0) if (hcl->log.len > 0)
@ -231,7 +232,7 @@ redo:
} }
hcl->log.ptr = tmp; hcl->log.ptr = tmp;
hcl->log.capa = newcapa - 1; /* -1 to handle line ending injection more easily */ hcl->log.capa = newcapa;
} }
while (len > 0) while (len > 0)