diff options
| author | Rutger Broekhoff | 2021-09-20 11:57:39 +0200 |
|---|---|---|
| committer | Rutger Broekhoff | 2021-09-20 11:57:39 +0200 |
| commit | 29fb00a1c3a60d4faca2fb29ae56b73362baa917 (patch) | |
| tree | 5542426d762402fb5beb66da3ae8c2bc42d80d89 /tool | |
| parent | 1148e92a6a84d5fa65e4e8ef18328fcb4f16664d (diff) | |
| download | zig-nkeys-29fb00a1c3a60d4faca2fb29ae56b73362baa917.tar.gz zig-nkeys-29fb00a1c3a60d4faca2fb29ae56b73362baa917.zip | |
Make compatible with Zig master0.3.1
Diffstat (limited to 'tool')
| -rw-r--r-- | tool/znk.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tool/znk.zig b/tool/znk.zig index 0a4b764..ff5540e 100644 --- a/tool/znk.zig +++ b/tool/znk.zig | |||
| @@ -443,11 +443,11 @@ fn PrefixKeyGenerator(comptime EntropyReaderType: type) type { | |||
| 443 | } | 443 | } |
| 444 | } else struct { | 444 | } else struct { |
| 445 | pub fn generate(self: *Self) !void { | 445 | pub fn generate(self: *Self) !void { |
| 446 | var cpu_count = try std.Thread.cpuCount(); | 446 | var cpu_count = try std.Thread.getCpuCount(); |
| 447 | var threads = try self.allocator.alloc(*std.Thread, cpu_count); | 447 | var threads = try self.allocator.alloc(std.Thread, cpu_count); |
| 448 | defer self.allocator.free(threads); | 448 | defer self.allocator.free(threads); |
| 449 | for (threads) |*thread| thread.* = try std.Thread.spawn(Self.generatePrivate, self); | 449 | for (threads) |*thread| thread.* = try std.Thread.spawn(.{}, Self.generatePrivate, .{ self }); |
| 450 | for (threads) |thread| thread.wait(); | 450 | for (threads) |thread| thread.join(); |
| 451 | } | 451 | } |
| 452 | }; | 452 | }; |
| 453 | }; | 453 | }; |
| @@ -526,7 +526,7 @@ pub fn readKeyFile(allocator: *Allocator, file: fs.File) ?Nkey { | |||
| 526 | allocator.free(bytes); | 526 | allocator.free(bytes); |
| 527 | } | 527 | } |
| 528 | 528 | ||
| 529 | var iterator = mem.split(bytes, "\n"); | 529 | var iterator = mem.split(u8, bytes, "\n"); |
| 530 | while (iterator.next()) |line| { | 530 | while (iterator.next()) |line| { |
| 531 | if (nkeys.isValidEncoding(line) and line.len == nkeys.text_seed_len) { | 531 | if (nkeys.isValidEncoding(line) and line.len == nkeys.text_seed_len) { |
| 532 | var k = Nkey.fromText(line) catch continue; | 532 | var k = Nkey.fromText(line) catch continue; |