Fix compilation

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2026-07-12 12:06:43 +02:00
parent 13544be6a8
commit f89e79c7f8
8 changed files with 38 additions and 37 deletions

View File

@@ -54,7 +54,7 @@ pub fn info(self: *LogFile, io: std.Io, category: []const u8, comptime message:
} else {
var buffer: [1024]u8 = undefined;
const slice = try std.fmt.bufPrint(&buffer, message, args);
const msg = try std.fmt.bufPrintZ(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice });
const msg = try std.fmt.bufPrintSentinel(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice }, 0);
std.posix.system.syslog(std.posix.LOG.INFO, msg.ptr);
}
@@ -72,7 +72,7 @@ pub fn err(self: *LogFile, io: std.Io, category: []const u8, comptime message: [
} else {
var buffer: [1024]u8 = undefined;
const slice = try std.fmt.bufPrint(&buffer, message, args);
const msg = try std.fmt.bufPrintZ(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice });
const msg = try std.fmt.bufPrintSentinel(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice }, 0);
std.posix.system.syslog(std.posix.LOG.ERR, msg.ptr);
}

View File

@@ -1,7 +1,7 @@
const std = @import("std");
const ErrInt = std.meta.Int(.unsigned, @bitSizeOf(anyerror));
const PaddingInt = std.meta.Int(.unsigned, 8 - (@bitSizeOf(ErrInt) + @bitSizeOf(bool)) % 8);
const ErrInt = @Int(.unsigned, @bitSizeOf(anyerror));
const PaddingInt = @Int(.unsigned, 8 - (@bitSizeOf(ErrInt) + @bitSizeOf(bool)) % 8);
const ErrorHandler = packed struct {
has_error: bool = false,

View File

@@ -355,7 +355,7 @@ pub fn setNumlock(val: bool) !void {
}
pub fn setUserContext(allocator: std.mem.Allocator, entry: UsernameEntry) !void {
const username_z = try allocator.dupeZ(u8, entry.username.?);
const username_z = try allocator.dupeSentinel(u8, entry.username.?, 0);
defer allocator.free(username_z);
return platform_struct.setUserContextImpl(username_z.ptr, entry);
@@ -371,10 +371,10 @@ pub fn setUserShell(entry: *UsernameEntry) void {
}
pub fn setEnvironmentVariable(allocator: std.mem.Allocator, name: []const u8, value: []const u8, replace: bool) !void {
const name_z = try allocator.dupeZ(u8, name);
const name_z = try allocator.dupeSentinel(u8, name, 0);
defer allocator.free(name_z);
const value_z = try allocator.dupeZ(u8, value);
const value_z = try allocator.dupeSentinel(u8, value, 0);
defer allocator.free(value_z);
const status = stdlib.setenv(name_z.ptr, value_z.ptr, @intFromBool(replace));