Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.fmt: print zeroed high-order bytes correctly in hex #1454

Merged
merged 2 commits into from Sep 2, 2018

Conversation

kristate
Copy link
Contributor

@kristate kristate commented Sep 2, 2018

Closes #1453 .

test "Print zeroed high-order bytes correctly" {
    const bytes_with_zeros = "\x00\x0E\xBA\xBE";
    try testFmt("lowercase: 000ebabe\n", "lowercase: {x}\n", bytes_with_zeros);
}

Thanks to @shawnl for the catch

kristopher tate and others added 2 commits September 2, 2018 15:04
\x00 was printed as 0 and \x0E was printed as E;
\x00 now correctly prints 00 and \x0E correctly prints 0E;
@kristate kristate changed the title Print zeroed high-order bytes correctly in hex std.fmt: print zeroed high-order bytes correctly in hex Sep 2, 2018
@andrewrk andrewrk merged commit 86e5556 into ziglang:master Sep 2, 2018
kristate added a commit to kristate/zig that referenced this pull request Sep 2, 2018
@kristate kristate deleted the str-hexbytes-issue1453 branch September 2, 2018 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants