On Wednesday 02 April 2008 07:37, Joerg Wunsch wrote:
> Update of bug #22800 (project avr-libc):
>
>              Assigned to:                    None => dmix
>
>     _______________________________________________________
>
> Follow-up Comment #1:
>
> Dmitry, can you check this, please?
>
> I think this is a bug somewhere in the following snippet:
>
>             case 's':
>               pnt = va_arg (ap, char *);
>               size = strnlen (pnt, (flags & FL_PREC) ? prec : ~0);
>             no_pgmstring:
>               flags &= ~FL_PGMSTRING;
>               goto str_lpad;
>
>             case 'S':
>               pnt = va_arg (ap, char *);
>               size = strnlen_P (pnt, (flags & FL_PREC) ? prec : ~0);
>               flags |= FL_PGMSTRING;
>
>             str_lpad:
>               if (!(flags & FL_LPAD)) {
>                   while (size < width) {
>                       putc (' ', stream);
>                       width--;
>                   }
>               }
>               while (size) {
>                   putc (GETBYTE (flags, FL_PGMSTRING, pnt), stream);
>                   if (width) width -= 1;
>                   size -= 1;
>               }
>
> My guess is that width has to be declared as uint16_t rather
> than unsigned char.  What do you think?

I will look this at the nearest time.

About width: the avr-libc-1.4 printf() has the documented
limit for width (and precision): 127.  The avr-libc-1.6
printf has this limit (also documented): 255.

Dmitry.



_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to