Commit ebc4c3e1 authored by Evgeniy Isaev's avatar Evgeniy Isaev Committed by Mouse

Fixed `format-nonliteral` warning

parent ca3d87a0
...@@ -131,7 +131,6 @@ REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key) ...@@ -131,7 +131,6 @@ REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key)
char local_buf[64]; char local_buf[64];
char *buf = local_buf; char *buf = local_buf;
ssize_t buflen = sizeof(local_buf); ssize_t buflen = sizeof(local_buf);
const char *fmt = canonical ? "%.17E" /* Precise */ : "%.15f" /* Pleasant*/;
ssize_t ret; ssize_t ret;
/* /*
...@@ -166,7 +165,10 @@ REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key) ...@@ -166,7 +165,10 @@ REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key)
* Use the libc's double printing, hopefully they got it right. * Use the libc's double printing, hopefully they got it right.
*/ */
do { do {
ret = snprintf(buf, buflen, fmt, d); ret = snprintf(buf,
buflen,
canonical ? "%.17E" /* Precise */ : "%.15f" /* Pleasant*/,
d);
if(ret < 0) { if(ret < 0) {
/* There are some old broken APIs. */ /* There are some old broken APIs. */
buflen <<= 1; buflen <<= 1;
......
...@@ -70,7 +70,7 @@ _print2fp(const void *buffer, size_t size, void *app_key) { ...@@ -70,7 +70,7 @@ _print2fp(const void *buffer, size_t size, void *app_key) {
* Some compilers do not support variable args macros. * Some compilers do not support variable args macros.
* This function is a replacement of ASN_DEBUG() macro. * This function is a replacement of ASN_DEBUG() macro.
*/ */
void ASN_DEBUG_f(const char *fmt, ...); void CC_PRINTFLIKE(1, 2) ASN_DEBUG_f(const char *fmt, ...);
void ASN_DEBUG_f(const char *fmt, ...) { void ASN_DEBUG_f(const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
......
...@@ -35,6 +35,7 @@ struct errbufDesc { ...@@ -35,6 +35,7 @@ struct errbufDesc {
}; };
static void static void
CC_PRINTFLIKE(4, 5)
_asn_i_ctfailcb(void *key, const asn_TYPE_descriptor_t *td, const void *sptr, _asn_i_ctfailcb(void *key, const asn_TYPE_descriptor_t *td, const void *sptr,
const char *fmt, ...) { const char *fmt, ...) {
struct errbufDesc *arg = key; struct errbufDesc *arg = key;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment