diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-05-29 03:22:52 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-05-29 03:22:52 -0400 |
| commit | cb042c8343eb94a8d149fe1f5d69aa2746aa85d0 (patch) | |
| tree | 36b9711c480b61c372c86bc47dd20a635d624d3a /std/cstr.zig | |
| parent | 7fa97b752e167de6df9a8a76999456d2c199b345 (diff) | |
| parent | eda6898c5b253367174172db909ee23013f32733 (diff) | |
| download | zig-cb042c8343eb94a8d149fe1f5d69aa2746aa85d0.tar.gz zig-cb042c8343eb94a8d149fe1f5d69aa2746aa85d0.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'std/cstr.zig')
| -rw-r--r-- | std/cstr.zig | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/std/cstr.zig b/std/cstr.zig index d396dcbce3..c9f3026064 100644 --- a/std/cstr.zig +++ b/std/cstr.zig @@ -9,7 +9,6 @@ pub const line_sep = switch (builtin.os) { else => "\n", }; - pub fn len(ptr: &const u8) usize { var count: usize = 0; while (ptr[count] != 0) : (count += 1) {} @@ -95,7 +94,7 @@ pub const NullTerminated2DArray = struct { } index_buf[i] = null; - return NullTerminated2DArray { + return NullTerminated2DArray{ .allocator = allocator, .byte_count = byte_count, .ptr = @ptrCast(?&?&u8, buf.ptr), @@ -107,4 +106,3 @@ pub const NullTerminated2DArray = struct { self.allocator.free(buf[0..self.byte_count]); } }; - |
