The size of the string in bytes happened to match the the pointer size on 64bit systems, nevertheless the logic was wrong would would fail on 32bit systems. Also use a character to search the string instead of a single character string.