> +     if (string[strlen(string) - 1] == '.')
> +             buf[strlen(string) - 1] = '\0';

Careful with out-of-bounds accesses. What if string is "" ? Probably
easiest to do "len = strlen(string);" and if (len > 0 && ...).

Reply via email to