[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA-dev: sscanf: check the read number of variables
On Wed, 2008-11-12 at 20:58 +0100, Werner Hoch wrote:
> Hi there,
>
> the current file format reading functions currently don't check the
> return value of sscanf.
> (e.g. in o_circle_read(), o_net_read(), ..)
>
> Should we add a check to prevent gschem from reading garbage files?
Sounds good"
What would be the action we take if we encounter a bad file:
Log message?
Refuse to load that element?
Refuse to load that file?
Make a best-effort guess to initialise the corrupt elements with default
values?
Btw.. any such mechanism should ideally use GError for reporting
run-time errors (if we're to propogate them down, and not just log the
message from the function containing the sscanf).
See Peter B's blog for some thoughts he wrote down after we had a
discussion on error handling some while back.
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev