bug #50517: Reading fails if "immediate mode" for output file format

is selected - fileio: invalid operation=1

* update.c (do_op): refuse to write to "immediate format" argument




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1464 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2021-11-07 16:22:00 +00:00
parent 1b3afa4cef
commit 84af4b36a1
3 changed files with 12 additions and 0 deletions

View File

@@ -230,6 +230,12 @@ int do_op(PROGRAMMER * pgm, struct avrpart * p, UPDATE * upd, enum updateflags f
/*
* read out the specified device memory and write it to a file
*/
if (upd->format == FMT_IMM) {
avrdude_message(MSG_INFO,
"%s: Invalid file format 'immediate' for output\n",
progname, upd->filename);
return -1;
}
if (quell_progress < 2) {
avrdude_message(MSG_INFO, "%s: reading %s memory:\n",
progname, mem->desc);