print/lcdf-typetools: avoid printf %n

ok tb@
This commit is contained in:
naddy 2021-09-12 20:00:26 +00:00
parent bc0bb6e558
commit 96c7027c9e
2 changed files with 16 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2020/09/02 10:34:28 bentley Exp $
# $OpenBSD: Makefile,v 1.2 2021/09/12 20:00:26 naddy Exp $
COMMENT = tools to manipulate font files
DISTNAME = lcdf-typetools-2.108
REVISION = 0
CATEGORIES = print

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-liblcdf_permstr_cc,v 1.1 2021/09/12 20:00:26 naddy Exp $
Index: liblcdf/permstr.cc
--- liblcdf/permstr.cc.orig
+++ liblcdf/permstr.cc
@@ -275,7 +275,7 @@ vpermprintf(const char *s, va_list val)
double x = va_arg(val, double);
char buffer[1000];
int len;
- sprintf(buffer, "%.10g%n", x, &len);
+ len = sprintf(buffer, "%.10g", x);
extend(len);
strcpy(psc + pspos, buffer);
pspos += len;