main: trivial errors

This commit is contained in:
Motiejus Jakštys 2022-07-03 06:39:33 +03:00
parent c294d149fc
commit 2e4229d613
2 changed files with 7 additions and 5 deletions

View File

@ -51,7 +51,7 @@ pub fn build(b: *zbs.Builder) void {
cmph.addIncludeDir("include/deps/cmph");
{
const exe = b.addExecutable("turbo-unix2db", "cli/unix2db/main.zig");
const exe = b.addExecutable("turbo-unix2db", "src/unix2db/main.zig");
exe.setTarget(target);
exe.setBuildMode(mode);
addCmphDeps(exe, cmph);

View File

@ -26,12 +26,14 @@ const usage =
pub fn main() !void {
// This line is here because of https://github.com/ziglang/zig/issues/7807
const argv: []const [*:0]const u8 = os.argv;
const gpa = GeneralPurposeAllocator(.{});
var gpa = GeneralPurposeAllocator(.{}){};
defer gpa.deinit();
const allocator = gpa.allocator();
const stderr = try io.getStdErr();
const stdout = try io.getStdOut();
const stderr = io.getStdErr().writer();
const stdout = io.getStdOut().writer();
const return_code = execute(gpa, stdout, stderr, argv[1..]);
const return_code = execute(allocator, stdout, stderr, argv[1..]);
os.exit(return_code);
}