Removing exit calls from config parser

* config.h: cleanup, left only internally needed definitions
* config.c: removed exit calls, use yyerror and yywarning
* config_gram.y: (Dito.)
* lexer.l: (Dito.)
* libavrdude.h: removed internal definitions of config parser
* main.c: removed yyerror, it is now in config.c
* jtagmkII.c: added missing free in error case
* pgm.c: replaced exits by returns
* pickit2.c: add missing return



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1322 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Rene Liebscher
2014-06-17 20:08:28 +00:00
parent c6788bd795
commit 2d2f71fb28
10 changed files with 329 additions and 207 deletions

4
pgm.c
View File

@@ -70,7 +70,7 @@ PROGRAMMER * pgm_new(void)
if (pgm == NULL) {
avrdude_message(MSG_INFO, "%s: out of memory allocating programmer structure\n",
progname);
exit(1);
return NULL;
}
memset(pgm, 0, sizeof(*pgm));
@@ -161,7 +161,7 @@ PROGRAMMER * pgm_dup(const PROGRAMMER * const src)
if (pgm == NULL) {
avrdude_message(MSG_INFO, "%s: out of memory allocating programmer structure\n",
progname);
exit(1);
return NULL;
}
memcpy(pgm, src, sizeof(*pgm));