Bruce Momjian <[EMAIL PROTECTED]> writes:
>                       /*
>                        *      We emulate fgets() behaviour. So if there is no newline
>                        *      at the end, we add one...
>                        */
> !                     if (line[len-1] != '\n')
>                               strcat(line,"\n");
>               }

This is untrustworthy if len is zero.  Perhaps

                        if (len == 0 || line[len-1] != '\n')
                                strcat(line,"\n");

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to