bug #26408: Crash in stk500v2_open()

* stk500generic.c: Implement setup and teardown hooks, calling in turn
the respective hooks of the stk500v2 implementation.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@824 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2009-07-02 09:11:45 +00:00
parent 12b0c0d17d
commit 38d792793c
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #26408: Crash in stk500v2_open()
* stk500generic.c: Implement setup and teardown hooks, calling in turn
the respective hooks of the stk500v2 implementation.
2009-07-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #26130: Avrdude doesn't display it's version.

View File

@ -65,9 +65,27 @@ static int stk500generic_open(PROGRAMMER * pgm, char * port)
return -1;
}
static void stk500generic_setup(PROGRAMMER * pgm)
{
/*
* Only STK500v2 needs setup/teardown.
*/
stk500v2_initpgm(pgm);
pgm->setup(pgm);
}
static void stk500generic_teardown(PROGRAMMER * pgm)
{
stk500v2_initpgm(pgm);
pgm->teardown(pgm);
}
void stk500generic_initpgm(PROGRAMMER * pgm)
{
strcpy(pgm->type, "STK500GENERIC");
pgm->open = stk500generic_open;
pgm->setup = stk500generic_setup;
pgm->teardown = stk500generic_teardown;
}