From: Matthew Fernandez Date: Thu, 22 Jul 2021 03:21:33 +0000 (-0700) Subject: trace: replace sfsprintf calls with snprintf X-Git-Tag: 2.49.0~40^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07b3f6afbdc527ac6fe6b51a1a5e89e76b7c3a99;p=graphviz trace: replace sfsprintf calls with snprintf Related to #1998. --- diff --git a/lib/expr/extoken.c b/lib/expr/extoken.c index c46d4dc4f..a71fbed22 100644 --- a/lib/expr/extoken.c +++ b/lib/expr/extoken.c @@ -19,6 +19,7 @@ #include #include +#include #include #if !defined(TRACE_lex) && _BLD_DEBUG @@ -76,7 +77,7 @@ trace(Expr_t* ex, int lev, char* op, int c) break; case FLOATING: s = " FLOATING "; - sfsprintf(t = buf, sizeof(buf), "%f", exlval.floating); + snprintf(t = buf, sizeof(buf), "%f", exlval.floating); break; case GE: s = " GE "; @@ -96,7 +97,7 @@ trace(Expr_t* ex, int lev, char* op, int c) break; case INTEGER: s = " INTEGER "; - sfsprintf(t = buf, sizeof(buf), "%I*d", sizeof(exlval.integer), exlval.integer); + snprintf(t = buf, sizeof(buf), "%lld", (long long)exlval.integer); break; case LABEL: s = " LABEL "; @@ -133,7 +134,7 @@ trace(Expr_t* ex, int lev, char* op, int c) break; case UNSIGNED: s = " UNSIGNED "; - sfsprintf(t = buf, sizeof(buf), "%I*u", sizeof(exlval.integer), exlval.integer); + snprintf(t = buf, sizeof(buf), "%llu", (unsigned long long)exlval.integer); break; case BREAK: s = " break";