[dia] [scan-buil] Result of operation is garbage or undefined (potentially)



commit 501dfaba1c8e2721e266aa492e2e9efd48d86192
Author: Hans Breuer <hans breuer org>
Date:   Sun Jun 8 18:47:21 2014 +0200

    [scan-buil] Result of operation is garbage or undefined (potentially)
    
    Current users of draw_arc_with_arrows() seem to behave, but if
    future users do not throw a g_warning() and try to draw the
    degenerated arc at least with intialized values.

 lib/diarenderer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index e2e50d3..4a83250 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -1272,7 +1272,8 @@ draw_arc_with_arrows (DiaRenderer *renderer,
 
   if (!find_center_point(&center, startpoint, endpoint, midpoint)) {
     /* Degenerate circle -- should have been caught by the drawer? */
-    printf("Degenerate\n");
+    g_warning("Degenerated arc in draw_arc_with_arrows()");
+    center = *startpoint; /* continue to draw something bogus ... */
   }
 
   righthand = is_right_hand (startpoint, midpoint, endpoint);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]