Mail Archives: geda-user/2023/03/31/04:29:43
This is a multipart MIME message.
--==_Exmh_1680249995_3450
Content-Type: text/plain; charset="utf-8"
With
./configure --with-printer= --with-gui= --with-exporters=
I get:
$ src/pcb -h
Segmentation fault
$
Attached patch fixes that.
Regards,
/Karl Hammar
--==_Exmh_1680249995_3450
Content-Type: text/plain; charset="utf-8" ; name="p2"
Content-Description: p2
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="p2"
diff --git a/src/main.c b/src/main.c
index a4646a39..cc968742 100644
--- a/src/main.c
+++ b/src/main.c
@@ -268,7 +268,7 @@ usage (void)
int i;
int n_printer =3D 0, n_gui =3D 0, n_exporter =3D 0;
=
- for (i =3D 0; hl[i]; i++)
+ for (i =3D 0; hl && hl[i]; i++)
{
if (hl[i]->gui)
n_gui++;
@@ -282,27 +282,27 @@ usage (void)
u ("%s [-h|-V|--copyright]\t\t\tHelp, version, copyright", Progname);
u ("%s [gui options] <pcb file>\t\tto edit", Progname);
u ("Available GUI hid%s:", n_gui =3D=3D 1 ? "" : "s");
- for (i =3D 0; hl[i]; i++)
+ for (i =3D 0; hl && hl[i]; i++)
if (hl[i]->gui)
fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description);
u ("%s -p [printing options] <pcb file>\tto print", Progname);
u ("Available printing hid%s:", n_printer =3D=3D 1 ? "" : "s");
- for (i =3D 0; hl[i]; i++)
+ for (i =3D 0; hl && hl[i]; i++)
if (hl[i]->printer)
fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description);
u ("%s -x hid [export options] <pcb file>\tto export", Progname);
u ("Available export hid%s:", n_exporter =3D=3D 1 ? "" : "s");
- for (i =3D 0; hl[i]; i++)
+ for (i =3D 0; hl && hl[i]; i++)
if (hl[i]->exporter)
fprintf (stderr, "\t%-8s %s\n", hl[i]->name, hl[i]->description);
=
- for (i =3D 0; hl[i]; i++)
+ for (i =3D 0; hl && hl[i]; i++)
if (hl[i]->gui)
usage_hid (hl[i]);
- for (i =3D 0; hl[i]; i++)
+ for (i =3D 0; hl && hl[i]; i++)
if (hl[i]->printer)
usage_hid (hl[i]);
- for (i =3D 0; hl[i]; i++)
+ for (i =3D 0; hl && hl[i]; i++)
if (hl[i]->exporter)
usage_hid (hl[i]);
=
@@ -381,7 +381,7 @@ print_defaults ()
HID_Attribute *e;
int i, n, hi;
=
- for (hi =3D 0; hl[hi]; hi++)
+ for (hi =3D 0; hl && hl[hi]; hi++)
{
HID *h =3D hl[hi];
if (h->gui)
--==_Exmh_1680249995_3450--
- Raw text -