| ... | ... | @@ -94,20 +94,20 @@ pub const Id = struct { |
| 94 | 94 | var values: [3][]const u8 = undefined; |
| 95 | 95 | |
| 96 | 96 | var split = mem.split(string, "."); |
| 97 | | var i: u4 = 0; |
| 97 | var count: u4 = 0; |
| 98 | 98 | while (split.next()) |value| { |
| 99 | | if (i > 2) { |
| 99 | if (count > 2) { |
| 100 | 100 | log.warn("malformed version field: {s}", .{string}); |
| 101 | 101 | return 0x10000; |
| 102 | 102 | } |
| 103 | | values[i] = value; |
| 104 | | i += 1; |
| 103 | values[count] = value; |
| 104 | count += 1; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | | if (values.len > 2) { |
| 107 | if (count > 2) { |
| 108 | 108 | out += try fmt.parseInt(u8, values[2], 10); |
| 109 | 109 | } |
| 110 | | if (values.len > 1) { |
| 110 | if (count > 1) { |
| 111 | 111 | out += @intCast(u32, try fmt.parseInt(u8, values[1], 10)) << 8; |
| 112 | 112 | } |
| 113 | 113 | out += @intCast(u32, try fmt.parseInt(u16, values[0], 10)) << 16; |