Set *err before *err_info - that's how it's done in most other modules.

svn path=/trunk/; revision=35807
This commit is contained in:
Guy Harris 2011-02-04 08:10:08 +00:00
parent 52638933cb
commit 4849599a13
1 changed files with 4 additions and 4 deletions

View File

@ -233,11 +233,11 @@ static gboolean k12text_read(wtap *wth, int *err, char ** err_info, gint64 *data
if (ok_frame == FALSE) {
if (at_eof) {
*err_info = NULL;
*err = 0;
*err_info = NULL;
} else {
*err_info = error_str;
*err = WTAP_ERR_BAD_RECORD;
*err_info = error_str;
}
return FALSE;
}
@ -270,21 +270,21 @@ static gboolean k12text_seek_read(wtap *wth, gint64 seek_off, union wtap_pseudo_
yylex();
if (ok_frame == FALSE) {
*err = WTAP_ERR_BAD_RECORD;
if (at_eof) {
/* What happened ? The desired frame was previously read without a problem */
*err_info = g_strdup("Unexpected EOF (program error ?)");
} else {
*err_info = error_str;
}
*err = WTAP_ERR_BAD_RECORD;
return FALSE;
}
/* verify frame length parsed this time against original frame length */
if (ii != (guint)length) {
/* What happened ? This now seems to have a different length than originally */
*err_info = g_strdup("Incorrect frame length (program error ?)");
*err = WTAP_ERR_BAD_RECORD;
*err_info = g_strdup("Incorrect frame length (program error ?)");
return FALSE;
}