correctly declare log functions and fix potential formatstring injection
This commit is contained in:
parent
ac3412155c
commit
0c5fc7b1f8
3 changed files with 9 additions and 3 deletions
|
@ -39,5 +39,5 @@ fn syslog(
|
|||
};
|
||||
var buf: [1024]u8 = undefined;
|
||||
const str = try fmt.bufPrintZ(&buf, format, args);
|
||||
c.syslog(priority, str.ptr);
|
||||
c.syslog(priority, "%s", str.ptr);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,10 @@ const debug = std.debug;
|
|||
const io = std.io;
|
||||
const meta = std.meta;
|
||||
|
||||
pub const log = @import("log.zig").log;
|
||||
pub const std_options = struct {
|
||||
pub const logFn = @import("log.zig").log;
|
||||
};
|
||||
|
||||
const logger = std.log.scoped(.wayprompt);
|
||||
|
||||
const Frontend = @import("Frontend.zig");
|
||||
|
|
|
@ -9,7 +9,10 @@ const fmt = std.fmt;
|
|||
const heap = std.heap;
|
||||
const debug = std.debug;
|
||||
|
||||
pub const log = @import("log.zig").log;
|
||||
pub const std_options = struct {
|
||||
pub const logFn = @import("log.zig").log;
|
||||
};
|
||||
|
||||
const logger = std.log.scoped(.wayprompt);
|
||||
var use_syslog = &@import("log.zig").use_syslog;
|
||||
|
||||
|
|
Loading…
Reference in a new issue