From ae2972359aa84c46f5b4a16cb14bccf4aabfa2fb Mon Sep 17 00:00:00 2001 From: ellson Date: Fri, 11 Mar 2005 18:48:10 +0000 Subject: [PATCH] janitor - be explicit about return value from sscanf --- lib/common/emit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index 77de2ef6e..c7872317a 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -1016,6 +1016,7 @@ static void init_job_viewport(GVC_t * gvc, graph_t * g) pointf UR, size; char *str; double X, Y, Z, x, y; + int rv; assert((GD_bb(g).LL.x == 0) && (GD_bb(g).LL.y == 0)); @@ -1046,7 +1047,8 @@ static void init_job_viewport(GVC_t * gvc, graph_t * g) /* user can override */ if ((str = agget(g, "viewport"))) - sscanf(str, "%lf,%lf,%lf,%lf,%lf", &X, &Y, &Z, &x, &y); + rv = sscanf(str, "%lf,%lf,%lf,%lf,%lf", &X, &Y, &Z, &x, &y); + /* rv is ignored since args retain previous values if not scanned */ job->width = ROUND(X + 1); job->height = ROUND(Y + 1); job->zoom = Z; /* scaling factor */ -- 2.40.0