Browse Source

Fixed segfault on empty or directory include.

pre-master-46
pnenzi 19 years ago
parent
commit
d9f9ad827d
  1. 4
      ChangeLog
  2. 7
      src/frontend/inpcom.c

4
ChangeLog

@ -1,3 +1,7 @@
2007-08-12 Paolo Nenzi <p.nenzi@ieee.org>
* src/frontend/inpcom.c: fixed segmentation fault with empty .include file
or directory include. This is a hack the full inpcom shoud be rewritten.
2007-06-17 Gong Ding <gdiso@ustc.edu>
* src/spicelib/devices/dev.c: use a more flexiable way to define device.
If it doesn't work, one can returen to old version (rename as dev_old.c).

7
src/frontend/inpcom.c

@ -289,12 +289,13 @@ inp_readall(FILE *fp, struct line **data)
end->li_actual = NULL;
end->li_line = copy(buffer);
end->li_linenum = line_number++;
end->li_next = newcard;
if (newcard) {
end->li_next = newcard;
/* Renumber the lines */
for (end = newcard; end && end->li_next; end = end->li_next)
end->li_linenum = line_number++;
end->li_linenum = line_number++; /* SJB - renumber the last line */
end->li_linenum = line_number++; /* SJB - renumber the last line */
}
/* Fix the buffer up a bit. */
(void) strncpy(buffer + 1, "end of:", 7);

Loading…
Cancel
Save