*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/exec.c,v 1.22 2004/08/16 01:26:31 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.23 2004/08/16 02:46:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* We emulate fgets() behaviour. So if there is no newline
* at the end, we add one...
*/
- if (line[len-1] != '\n')
+ if (len == 0 || line[len-1] != '\n')
strcat(line,"\n");
}