1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
* elf/rtld.c (process_dl_debug): Correct printing help message.
	* elf/dl-misc.c (_dl_debug_vdprintf): Implement precision handling
	for %s.
This commit is contained in:
Ulrich Drepper
2002-02-06 00:19:11 +00:00
parent f2b98f97eb
commit 37d8b77856
3 changed files with 18 additions and 4 deletions

View File

@ -135,6 +135,7 @@ _dl_debug_vdprintf (int fd, int tag_p, const char *fmt, va_list arg)
/* It is a format specifier. */
char fill = ' ';
int width = -1;
int prec = -1;
#if LONG_MAX != INT_MAX
int long_mod = 0;
#endif
@ -154,6 +155,13 @@ _dl_debug_vdprintf (int fd, int tag_p, const char *fmt, va_list arg)
++fmt;
}
/* Handle precision. */
if (*fmt == '.' && fmt[1] == '*')
{
prec = va_arg (arg, int);
fmt += 2;
}
/* Recognize the l modifier. It is only important on some
platforms where long and int have a different size. We
can use the same code for size_t. */
@ -202,6 +210,8 @@ _dl_debug_vdprintf (int fd, int tag_p, const char *fmt, va_list arg)
/* Get the string argument. */
iov[niov].iov_base = va_arg (arg, char *);
iov[niov].iov_len = strlen (iov[niov].iov_base);
if (prec != -1)
iov[niov].iov_len = MIN (prec, iov[niov].iov_len );
++niov;
break;