fileio.c : Remove superfluous assignment of 'fname'.

main.c : print out '<stdin>' and '<stdout>' instead of '-' when using
         stdio for I/O.

Thanks to Francisco T. A. Silva <ftas@geodigitus.com.br> for catching
this, and the error fixed by the previous commit as well.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@325 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean 2003-05-07 22:13:46 +00:00
parent 74bb2d7275
commit ba8da0de7a
2 changed files with 2 additions and 3 deletions

View File

@ -1019,7 +1019,6 @@ int fileio(int op, char * filename, FILEFMT format,
if (format != FMT_IMM) { if (format != FMT_IMM) {
if (!using_stdio) { if (!using_stdio) {
fname = filename;
f = fopen(fname, fio.mode); f = fopen(fname, fio.mode);
if (f == NULL) { if (f == NULL) {
fprintf(stderr, "%s: can't open %s file %s: %s\n", fprintf(stderr, "%s: can't open %s file %s: %s\n",

4
main.c
View File

@ -887,7 +887,7 @@ int main(int argc, char * argv [])
size = rc; size = rc;
fprintf(stderr, "%s: writing output file \"%s\"\n", fprintf(stderr, "%s: writing output file \"%s\"\n",
progname, outputf); progname, strcmp(outputf, "-")==0 ? "<stdout>" : outputf);
rc = fileio(FIO_WRITE, outputf, filefmt, p, memtype, size); rc = fileio(FIO_WRITE, outputf, filefmt, p, memtype, size);
if (rc < 0) { if (rc < 0) {
fprintf(stderr, "%s: terminating\n", progname); fprintf(stderr, "%s: terminating\n", progname);
@ -902,7 +902,7 @@ int main(int argc, char * argv [])
* read the data from the specified file * read the data from the specified file
*/ */
fprintf(stderr, "%s: reading input file \"%s\"\n", fprintf(stderr, "%s: reading input file \"%s\"\n",
progname, inputf); progname, strcmp(inputf, "-")==0 ? "<stdin>" : inputf);
rc = fileio(FIO_READ, inputf, filefmt, p, memtype, -1); rc = fileio(FIO_READ, inputf, filefmt, p, memtype, -1);
if (rc < 0) { if (rc < 0) {
fprintf(stderr, "%s: terminating\n", progname); fprintf(stderr, "%s: terminating\n", progname);