diff options
| author | 2023-12-06 22:45:00 +0100 | |
|---|---|---|
| committer | 2023-12-06 22:45:00 +0100 | |
| commit | 3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0 (patch) | |
| tree | 97fcd33314eb1a6e7309c19bb7233f00ed717832 /vtab.zig | |
| parent | Merge pull request #146 from Krvopije/master (diff) | |
| download | zig-sqlite-3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0.tar.gz zig-sqlite-3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0.tar.xz zig-sqlite-3d8e617c43d047b87bcbf74e9b6d26caf9f3f4f0.zip | |
fix for latest zig
Diffstat (limited to 'vtab.zig')
| -rw-r--r-- | vtab.zig | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -35,7 +35,7 @@ pub const ModuleContext = struct { | |||
| 35 | fn dupeToSQLiteString(s: []const u8) [*c]const u8 { | 35 | fn dupeToSQLiteString(s: []const u8) [*c]const u8 { |
| 36 | var buffer: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(s.len + 1))); | 36 | var buffer: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(s.len + 1))); |
| 37 | 37 | ||
| 38 | mem.copy(u8, buffer[0..s.len], s); | 38 | mem.copyForwards(u8, buffer[0..s.len], s); |
| 39 | buffer[s.len] = 0; | 39 | buffer[s.len] = 0; |
| 40 | 40 | ||
| 41 | return buffer; | 41 | return buffer; |
| @@ -253,7 +253,7 @@ pub const BestIndexBuilder = struct { | |||
| 253 | // Must always be NULL-terminated so add 1 | 253 | // Must always be NULL-terminated so add 1 |
| 254 | const tmp: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(self.id.str.len + 1))); | 254 | const tmp: [*c]u8 = @ptrCast(c.sqlite3_malloc(@intCast(self.id.str.len + 1))); |
| 255 | 255 | ||
| 256 | mem.copy(u8, tmp[0..self.id.str.len], self.id.str); | 256 | mem.copyForwards(u8, tmp[0..self.id.str.len], self.id.str); |
| 257 | tmp[self.id.str.len] = 0; | 257 | tmp[self.id.str.len] = 0; |
| 258 | 258 | ||
| 259 | index_info.idxStr = tmp; | 259 | index_info.idxStr = tmp; |