YoushouldhavereceivedcopiesoftheGNUGeneralPublicLicenseandthe GNULesserGeneralPublicLicensealongwiththeGNUMPLibrary.Ifnot,
see https://www.gnu.org/licenses/. */
/* glibc 2.0.x vsnprintf returns either -1 or size-1 for an overflow, with noindicationhowbigtheoutputwouldhavebeen.It'snecessaryto re-runtodeterminethatsize.
vsnprintfmighttrashit'sgivenap(itdoesforinstanceinglibc2.1.3 onpowerpc),socopyitincaseweneedtouseittoprobeforthesize outputthatwouldhavebeenproduced.Notethere'snoneedtopreserve
it for our callers, just for ourselves. */
/* probably glibc 2.0.x truncated output, probe for actual size */
alloc = MAX (128, ret);
} else
{ /* no space to write anything, just probe for size */
alloc = 128;
}
do
{
alloc *= 2;
p = __GMP_ALLOCATE_FUNC_TYPE (alloc, char);
va_copy (ap, orig_ap);
ret = vsnprintf (p, alloc, fmt, ap);
__GMP_FREE_FUNC_TYPE (p, alloc, char);
} while (ret == alloc-1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.