diff options
Diffstat (limited to 'src/Core.zig')
| -rw-r--r-- | src/Core.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Core.zig b/src/Core.zig index 775d1e9a..5496a979 100644 --- a/src/Core.zig +++ b/src/Core.zig @@ -1334,16 +1334,16 @@ pub fn saveFailed(p: *Pardes, id: u8, path: []const u8, err: anyerror) void { // The `-%` spelling fs.zig already uses for "make this dirty". f.saved_revision = f.revision -% 1; }; - var what: [limits.host_path_cap + 32]u8 = undefined; + var what: pardes.Kind.Buf(limits.host_path_cap + 32) = .{}; // A write into a directory that is not there: said so, in the words // a mount reads as ENOENT; EACCES when one above refuses. const parent = parentTrouble(path, err); if (parent.denied) - p.reportFailure(id, std.fmt.bufPrint(&what, "Save {s}: permission denied", .{path[0..@min(path.len, limits.host_path_cap)]}) catch unreachable) // cap + 24 fits cap + 32 + p.reportFailure(id, what.print("Save {s}: permission denied", .{path[0..@min(path.len, limits.host_path_cap)]})) else if (parent.missing) - p.reportFailure(id, std.fmt.bufPrint(&what, "Save {s}: no such directory", .{path[0..@min(path.len, limits.host_path_cap)]}) catch unreachable) // cap + 24 fits cap + 32 + p.reportFailure(id, what.print("Save {s}: no such directory", .{path[0..@min(path.len, limits.host_path_cap)]})) else - p.reportError(id, std.fmt.bufPrint(&what, "Save {s}", .{path[0..@min(path.len, limits.host_path_cap)]}) catch unreachable, err); // cap + 5 fits cap + 32 + p.reportError(id, what.print("Save {s}", .{path[0..@min(path.len, limits.host_path_cap)]}), err); p.noteLateFailure(id); } @@ -1733,8 +1733,8 @@ pub fn windowOpacityDone(p: *Pardes, applied: u8, failure: ?[]const u8) void { // Do not claim a value the compositor refused; an explicit retry of // the same command will arm a new request. p.settings.window_opacity = applied; - var buf: [240 + 16]u8 = undefined; - p.setMessage(p.view().active, std.fmt.bufPrint(&buf, "WindowOpacity: {s}", .{reason[0..@min(reason.len, 240)]}) catch unreachable); // 240 + 15 fits 240 + 16 + var buf: pardes.Kind.Buf(240 + 16) = .{}; + p.setMessage(p.view().active, buf.print("WindowOpacity: {s}", .{reason})); } /// Recompute geometry, push grid-size changes to each emulator and pty, |
