Skip to content

Instantly share code, notes, and snippets.

@alsamitech
Created July 27, 2021 04:30
Show Gist options
  • Save alsamitech/3261055c684375ff5fb51b1fa32e0bb2 to your computer and use it in GitHub Desktop.
Save alsamitech/3261055c684375ff5fb51b1fa32e0bb2 to your computer and use it in GitHub Desktop.
strcmp_until - faster than doing strncmp with passing until_char
_Bool strcmp_until(const char* s1,const char* s2,const char until){
for(size_t i=0;s1[i]!=until;i++)
if(s1[i]!=s2[i])return 1;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment