fixing runtime crash
This commit is contained in:
@@ -19,7 +19,9 @@ pub fn build(b: *std.Build) void {
|
||||
}),
|
||||
});
|
||||
example.root_module.addImport("drm", drm);
|
||||
b.installArtifact(example);
|
||||
const run_example = b.addRunArtifact(example);
|
||||
const example_step = b.step("example", "Run example.");
|
||||
example_step.dependOn(&run_example.step);
|
||||
|
||||
const test_exe = b.addTest(.{ .root_module = drm });
|
||||
const run_tests = b.addRunArtifact(test_exe);
|
||||
|
||||
+1
-1
@@ -312,7 +312,7 @@ fn sysfsUeventGet(
|
||||
|
||||
var it = std.mem.tokenizeScalar(u8, content, '\n');
|
||||
while (it.next()) |line| {
|
||||
if (std.mem.eql(u8, line[0..key.len], key) and line[key.len] == '=') {
|
||||
if (line.len > key.len and std.mem.eql(u8, line[0..key.len], key) and line[key.len] == '=') {
|
||||
return gpa.dupe(u8, line[key.len + 1 ..]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user