Created
June 24, 2017 23:48
-
-
Save rgkirch/049d20c9d8c4564be72f5fac22df348e to your computer and use it in GitHub Desktop.
Just found the bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void correct(function<void(char)> f) { | |
vector<char> cs {'\x1B','\x25','\x01','\x1B','\x26','\x01'}; | |
for ( auto c : cs ) f(c); | |
} | |
void wrong(Object o) { | |
o.print("\x1B\x25\x01\x1B\x26\x01"); | |
} | |
// wrong is wrong because it prints | |
// 27 37 1 27 38 1 0 | |
// while correct is correct because it prints | |
// 27 37 1 27 38 1 | |
// ...sigh... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment