if (i == 0)
return (false);
/* '..', two dots together is not allowed. */
- else if (input[i-1] == '.')
+ if (input[i-1] == '.')
return (false);
/* '.' is not allowed as last char */
- if (i == len)
+ if (i == len - 1)
return (false);
/* only 1 dot in ok location, continue at next char */
continue;
if (i == 0)
return (false);
/* '..', two dots together is not allowed. */
- else if (input[i-1] == '.')
+ if (input[i-1] == '.')
return (false);
/* '.' is not allowed as last char */
- if (i == len)
+ if (i == len - 1)
return (false);
/* only 1 dot in ok location, continue at next char */
continue;