diff --git a/gsk/gskpathpoint.c b/gsk/gskpathpoint.c index 07e3bf77ce..0e550d69f2 100644 --- a/gsk/gskpathpoint.c +++ b/gsk/gskpathpoint.c @@ -54,15 +54,23 @@ G_DEFINE_BOXED_TYPE (GskPathPoint, gsk_path_point, gsk_path_point_free) -const char * +char * gsk_path_point_to_string (GskPathPoint *point) { GskRealPathPoint *p = (GskRealPathPoint *) point; - static char buf[128]; - g_snprintf (buf, sizeof (buf), - "{ .contour = %lu, .idx = %lu, .t = %.9f }", - p->contour, p->idx, p->t); - return buf; + + return g_strdup_printf ("{ .contour = %lu, .idx = %lu, .t = %.9f }", + p->contour, p->idx, p->t); +} + +void +gsk_path_point_print (GskPathPoint *point) +{ + char *s; + + s = gsk_path_point_to_string (point); + g_print ("%s\n", s); + g_free (s); } GskPathPoint * diff --git a/gsk/gskpathpointprivate.h b/gsk/gskpathpointprivate.h index f065f043e0..31bc42fea7 100644 --- a/gsk/gskpathpointprivate.h +++ b/gsk/gskpathpointprivate.h @@ -14,7 +14,8 @@ struct _GskRealPathPoint G_STATIC_ASSERT (sizeof (GskRealPathPoint) <= sizeof (GskPathPoint)); -const char * gsk_path_point_to_string (GskPathPoint *point); +char * gsk_path_point_to_string (GskPathPoint *point); +void gsk_path_point_print (GskPathPoint *point); G_END_DECLS