あのなぁ。
if (*str) って書くなら、素直に if (*str != '\0') って書け。
省略すればいいって訳じゃないぜ。
if (isalpha(XXX)) とか、if (found) はこう書くべきだがな。