From 4ec4de4f8b236af027d84b02209475f0c99a500e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 12 Jan 2003 15:45:29 +0000 Subject: [PATCH] Ahem. Doing loads of stuff to inst->cfg would probably be best done _after_ allocating inst. Oops. [originally from svn r2571] --- unix/pterm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unix/pterm.c b/unix/pterm.c index cc6b2d05..d31e884f 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -2251,12 +2251,6 @@ int main(int argc, char **argv) gtk_init(&argc, &argv); - if (do_cmdline(argc, argv, 0, &inst->cfg)) - exit(1); /* pre-defaults pass to get -class */ - do_defaults(NULL, &inst->cfg); - if (do_cmdline(argc, argv, 1, &inst->cfg)) - exit(1); /* post-defaults, do everything */ - /* * Create an instance structure and initialise to zeroes */ @@ -2264,6 +2258,12 @@ int main(int argc, char **argv) memset(inst, 0, sizeof(*inst)); inst->alt_keycode = -1; /* this one needs _not_ to be zero */ + if (do_cmdline(argc, argv, 0, &inst->cfg)) + exit(1); /* pre-defaults pass to get -class */ + do_defaults(NULL, &inst->cfg); + if (do_cmdline(argc, argv, 1, &inst->cfg)) + exit(1); /* post-defaults, do everything */ + inst->fonts[0] = gdk_font_load(inst->cfg.font); if (!inst->fonts[0]) { fprintf(stderr, "pterm: unable to load font \"%s\"\n", inst->cfg.font);