~bitfehler/apk-index-update

1927d4febd55ec59b5b3fe51dd432c04528bbf2e — Conrad Hoffmann 3 months ago 9a40e94
Fix invalid memory access

And free scanner when done.
1 files changed, 2 insertions(+), 1 deletions(-)

M main.ha
M main.ha => main.ha +2 -1
@@ 23,6 23,7 @@ fn read_index(f: io::file) ([]package | io::error | utf8::invalid) = {
	};

	let sc = bufio::newscanner(f, types::SIZE_MAX);
	defer bufio::finish(&sc);

	for (true) match (bufio::scan_line(&sc)?) {
	case io::EOF => break;


@@ 34,7 35,7 @@ fn read_index(f: io::file) ([]package | io::error | utf8::invalid) = {
				props = [],
			};
		} else {
			append(current.props, s);
			append(current.props, strings::dup(s));
			if (strings::hasprefix(s, "P:")) {
				let name = strings::sub(s, 2, strings::end);
				current.name = strings::dup(name);