Created
December 8, 2017 08:52
-
-
Save deadc0de6/99d6576dc77faa43b30b0dfa7076fb1f to your computer and use it in GitHub Desktop.
This file contains 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
find_null(Bin, Pos) -> | |
case Bin of | |
<<Start:Pos/binary, 0, Rest/binary>> -> | |
% found | |
{Start, Rest}; | |
<<Bin:Pos/binary>> -> | |
% not found | |
error; | |
<<_:Pos/binary, _/binary>>=B -> | |
% go forward | |
find_null(B, Pos+1) | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment