summaryrefslogtreecommitdiff
path: root/lgl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-09-25 10:28:20 +0200
committerSimon Josefsson <simon@josefsson.org>2008-09-25 10:28:20 +0200
commitb397b7fb47233433bfb3cb0838a2aa361d9e97ac (patch)
tree8453e4a2d5f52112220a2b8c3b68ee86c11835d5 /lgl
parent4eacdf42547bb38b260c8ac75347afcd800c299b (diff)
downloadgnutls-b397b7fb47233433bfb3cb0838a2aa361d9e97ac.tar.gz
Update gnulib files.
Diffstat (limited to 'lgl')
-rw-r--r--lgl/vasnprintf.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/lgl/vasnprintf.c b/lgl/vasnprintf.c
index 68cc2acf47..f1e6ac65d0 100644
--- a/lgl/vasnprintf.c
+++ b/lgl/vasnprintf.c
@@ -2663,9 +2663,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* POSIX specifies the default precision to be 6 for %f, %F,
%e, %E, but not for %g, %G. Implementations appear to use
- the same default precision also for %g, %G. */
+ the same default precision also for %g, %G. But for %a, %A,
+ the default precision is 0. */
if (!has_precision)
- precision = 6;
+ if (!(dp->conversion == 'a' || dp->conversion == 'A'))
+ precision = 6;
/* Allocate a temporary buffer of sufficient size. */
# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE
@@ -3182,6 +3184,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
*p++ = '0';
}
}
+ else if (dp->conversion == 'a' || dp->conversion == 'A')
+ {
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+ *p++ = '+';
+ *p++ = '0';
+ }
else
abort ();
# endif