(Unintentionally?) dead code in s_path.c

Bug #959713 reported by Gareth Edwards
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA
Confirmed
Low
Peter Clifton

Bug Description

Coverity-ID: 201569

In function s_path_parse_do_cmd(), there is a flow of control after line 440 that looks like:

    if (ctx->param == 2 || final) {
      double xc, yc; /* quadratic control point */
...
    } else if (final) {
      if (ctx->param > 2) {
...

The second branch will never be taken since, if execution reaches this point, final must be 0. This looks like a bug to me rather than truly dead code.

Revision history for this message
Peter TB Brett (peter-b) wrote :

I think this is one for pcjc2... :-)

Changed in geda:
assignee: nobody → Peter Clifton (pcjc2)
Revision history for this message
Peter Clifton (pcjc2) wrote :

Just a note, haven't had a chance to look in detail yet, but this code is from / based on code from librsvg, so it might be worth comparing to that and seeing whether the bug was present there, or introduced by me.

Revision history for this message
Gareth Edwards (gareth-uk) wrote :

Confirmed that the bug is in the upstream code.

Revision history for this message
Gareth Edwards (gareth-uk) wrote :
Changed in geda:
status: New → Confirmed
Peter TB Brett (peter-b)
Changed in geda:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.