Skip to content

Commit

Permalink
call realloc for strings so that they're the right size
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed May 23, 2019
1 parent 73d6d5e commit dd3960b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/util/value.c
Original file line number Diff line number Diff line change
Expand Up @@ -4238,7 +4238,13 @@ char *fr_value_box_asprint(TALLOC_CTX *ctx, fr_value_box_t const *data, char quo
* trunctate the decimal point. i.e. Don't print
* "5."
*/
if (*q == '.') *q = '\0';
if (*q == '.') {
*q = '\0';
} else {
q++; /* to account for q-- above */
}

p = talloc_bstr_realloc(ctx, p, q - p);
}
break;

Expand Down

0 comments on commit dd3960b

Please sign in to comment.