X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctgraphics%2Fezsupport.cpp;h=de495e90b778eb48c704230af70adec879148f88;hb=b8d8c64ac7fe071dd806064ae37f48e0e5b153bd;hp=51f97423d7f92a0489eb489f4a73c1311e3a0e06;hpb=bf7295a63667dcca309389ee6dd5328a3a25f22b;p=ctsim.git diff --git a/libctgraphics/ezsupport.cpp b/libctgraphics/ezsupport.cpp index 51f9742..de495e9 100644 --- a/libctgraphics/ezsupport.cpp +++ b/libctgraphics/ezsupport.cpp @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ezsupport.cpp,v 1.1 2000/06/19 18:05:03 kevin Exp $ +** $Id: ezsupport.cpp,v 1.3 2000/07/04 18:33:35 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -20,7 +20,7 @@ #include #include -#include "kstddef.h" +#include "ctsupport.h" #include "ezplot.h" @@ -151,7 +151,7 @@ make_numfmt (char *fmtstr, int *fldwid, int *nfrac, double minval, double maxval wid = 2 + frac + expon; if (minval < 0. || maxval < 0.) ++wid; - snprintf (fmtstr, sizeof(fmtstr), "%%%d.%dle", wid, frac); + sprintf (fmtstr, "%s%d%s%d%s", "%", wid, ".", frac, "g"); } else { /* use fixed format */ wid = static_cast(trunc(logt)) + 1; if (wid < 1) @@ -168,9 +168,9 @@ make_numfmt (char *fmtstr, int *fldwid, int *nfrac, double minval, double maxval frac = *nfrac; wid += 1 + frac; - snprintf (fmtstr, sizeof(fmtstr), "%%%d.%dlf", wid, frac); + sprintf (fmtstr, "%s%d%s%d%s", "%", wid, ".", frac, "f"); } - + *fldwid = wid; *nfrac = frac; }