From Liviu Daia <Liviu.Daia[AT]imar.ro>: move "col_init()" call after

the command-line options are processed, so that we don't crash if you've
set the "column.format" preference from the command line.

Fix a grammaro in a comment.

svn path=/trunk/; revision=5838
This commit is contained in:
Guy Harris 2002-07-07 21:52:51 +00:00
parent e6f71eff0d
commit 192749474f
4 changed files with 12 additions and 6 deletions

View File

@ -1311,6 +1311,11 @@ Nix <nix[AT]esperi.demon.co.uk> {
Expand the plugin directory path at install time
}
Liviu Daia <Liviu.Daia[AT]imar.ro> {
Fix to eliminate crash when setting "column.format" preference
from the command line
}
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.

View File

@ -1459,6 +1459,7 @@ B<http://www.ethereal.com>.
Anand V. Narwani <anarwani[AT]cisco.com>
Christopher K. St. John <cks[AT]distributopia.com>
Nix <nix[AT]esperi.demon.co.uk>
Liviu Daia <Liviu.Daia[AT]imar.ro>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
permission to use his version of snprintf.c.

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.253 2002/07/06 16:47:17 gerald Exp $
* $Id: main.c,v 1.254 2002/07/07 21:52:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1401,7 +1401,6 @@ main(int argc, char *argv[])
cfile.has_snap = FALSE;
cfile.snap = WTAP_MAX_PACKET_SIZE;
cfile.count = 0;
col_init(&cfile.cinfo, prefs->num_cols);
/* Assemble the compile-time options */
comp_info_str = g_string_new("");
@ -1748,7 +1747,7 @@ main(int argc, char *argv[])
/* Notify all registered modules that have had any of their preferences
changed either from one of the preferences file or from the command
line that its preferences have changed. */
line that their preferences have changed. */
prefs_apply_all();
#ifndef HAVE_LIBPCAP
@ -1797,6 +1796,7 @@ main(int argc, char *argv[])
#endif
/* Build the column format array */
col_init(&cfile.cinfo, prefs->num_cols);
for (i = 0; i < cfile.cinfo.num_cols; i++) {
cfile.cinfo.col_fmt[i] = get_column_format(i);
cfile.cinfo.col_title[i] = g_strdup(get_column_title(i));

View File

@ -1,6 +1,6 @@
/* tethereal.c
*
* $Id: tethereal.c,v 1.146 2002/06/30 20:26:45 guy Exp $
* $Id: tethereal.c,v 1.147 2002/07/07 21:52:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -403,7 +403,6 @@ main(int argc, char *argv[])
cfile.has_snap = FALSE;
cfile.snap = WTAP_MAX_PACKET_SIZE;
cfile.count = 0;
col_init(&cfile.cinfo, prefs->num_cols);
/* Assemble the compile-time options */
comp_info_str = g_string_new("");
@ -742,7 +741,7 @@ main(int argc, char *argv[])
/* Notify all registered modules that have had any of their preferences
changed either from one of the preferences file or from the command
line that its preferences have changed. */
line that their preferences have changed. */
prefs_apply_all();
#ifndef HAVE_LIBPCAP
@ -755,6 +754,7 @@ main(int argc, char *argv[])
}
/* Build the column format array */
col_init(&cfile.cinfo, prefs->num_cols);
for (i = 0; i < cfile.cinfo.num_cols; i++) {
cfile.cinfo.col_fmt[i] = get_column_format(i);
cfile.cinfo.col_title[i] = g_strdup(get_column_title(i));