Interesting approach. This doesn't always work, though (if the difference of any character before just happens to be the value of '=', then it will also match, but return the wrong value. If you want to do it like that, you should probably memcmp with strlen(name) and check for equality, and if that succeeds, check if the following character is a "=". Or use strtok_r with "=" or something.