>>417
じゃおまいはこう書け
if (!(len = strlen(str), buf = (char *)malloc(len+1)))