~sircmpwn/hare

36a475c57d23f9b04f9e0a2024d3647419095bf9 — Bor Grošelj Simić 8 months ago 1632ae5
fmt: fix memory leak
1 files changed, 2 insertions(+), 2 deletions(-)

M fmt/fmt.ha
M fmt/fmt.ha => fmt/fmt.ha +2 -2
@@ 72,7 72,7 @@ export fn errorfln(fmt: str, args: formattable...) (io::error | size) =
export fn asprintf(fmt: str, args: formattable...) str = {
	let buf = bufio::dynamic(io::mode::WRITE);
	assert(fprintf(buf, fmt, args...) is size);
	return strings::from_utf8_unsafe(bufio::buffer(buf));
	return strings::from_utf8_unsafe(bufio::finish(buf));
};

// Formats text for printing and writes it into a caller supplied buffer. The


@@ 126,7 126,7 @@ export fn errorln(args: formattable...) (io::error | size) =
export fn asprint(args: formattable...) str = {
	let buf = bufio::dynamic(io::mode::WRITE);
	assert(fprint(buf, args...) is size);
	return strings::from_utf8_unsafe(bufio::buffer(buf));
	return strings::from_utf8_unsafe(bufio::finish(buf));
};

// Formats values for printing using the default format modifiers and writes