diff --git a/ChangeLog b/ChangeLog index 2a785554d..d83115fd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-09-12 Robert Larice + * src/main.c : + fix incorrect buffer type, and exit(1) on failure to open a tempfile + 2010-09-08 Holger Vogt * inp.c, inpcom.c: include libiberty.h removed * terminal.c, ivars.c, ifnewuid.c, inperror.c, tclspice.c, main.c: diff --git a/src/main.c b/src/main.c index 9b2d3a700..a12f965cc 100644 --- a/src/main.c +++ b/src/main.c @@ -629,7 +629,7 @@ show_version(void) static void append_to_stream(FILE *dest, FILE *source) { - char *buf[BSIZE_SP]; + char buf[BSIZE_SP]; int i; while ((i = fread(buf, 1, BSIZE_SP, source)) > 0) @@ -1084,6 +1084,11 @@ bot: } #endif + if(!tempfile) { + perror("tmpfile()"); + exit(1); + } + if (optind == argc && !istty) { append_to_stream(tempfile, stdin); }