summaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/mprintf.c
diff options
context:
space:
mode:
authorrobot-contrib <[email protected]>2022-12-02 16:18:16 +0300
committerrobot-contrib <[email protected]>2022-12-02 16:18:16 +0300
commit22a73deb46c33ab8539b522286f0fb9b3364f856 (patch)
treeaf3cf69e9e6ebc887a5add5491b2fcebbfdff06a /contrib/libs/curl/lib/mprintf.c
parent2e7d246d83a0077f08e6fed36594fc2087949502 (diff)
Update contrib/libs/curl to 7.86.0
Diffstat (limited to 'contrib/libs/curl/lib/mprintf.c')
-rw-r--r--contrib/libs/curl/lib/mprintf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/libs/curl/lib/mprintf.c b/contrib/libs/curl/lib/mprintf.c
index 30347de250f..8a7c17a7ffb 100644
--- a/contrib/libs/curl/lib/mprintf.c
+++ b/contrib/libs/curl/lib/mprintf.c
@@ -318,6 +318,11 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto,
flags |= FLAGS_PREC;
precision = strtol(fmt, &fmt, 10);
}
+ if((flags & (FLAGS_PREC | FLAGS_PRECPARAM)) ==
+ (FLAGS_PREC | FLAGS_PRECPARAM))
+ /* it is not permitted to use both kinds of precision for the same
+ argument */
+ return 1;
break;
case 'h':
flags |= FLAGS_SHORT;
@@ -956,7 +961,7 @@ static int dprintf_formatf(
else
*fptr++ = 'f';
- *fptr = 0; /* and a final zero termination */
+ *fptr = 0; /* and a final null-termination */
#ifdef __clang__
#pragma clang diagnostic push
@@ -964,7 +969,11 @@ static int dprintf_formatf(
#endif
/* NOTE NOTE NOTE!! Not all sprintf implementations return number of
output characters */
+#ifdef HAVE_SNPRINTF
+ (snprintf)(work, sizeof(work), formatbuf, p->data.dnum);
+#else
(sprintf)(work, formatbuf, p->data.dnum);
+#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif