diff --git a/lib/bigint.c b/lib/bigint.c index ddeb0a1..6cffc00 100644 --- a/lib/bigint.c +++ b/lib/bigint.c @@ -192,7 +192,7 @@ static int is_normalized_integer (hcl_t* hcl, hcl_oop_t oop) 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; diff --git a/lib/logfmt.c b/lib/logfmt.c index db8e707..e67fdef 100644 --- a/lib/logfmt.c +++ b/lib/logfmt.c @@ -217,7 +217,8 @@ redo: } 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 (hcl->log.len > 0) @@ -231,7 +232,7 @@ redo: } hcl->log.ptr = tmp; - hcl->log.capa = newcapa - 1; /* -1 to handle line ending injection more easily */ + hcl->log.capa = newcapa; } while (len > 0)