* [ECOS] sprintf problem in redboot?
@ 2001-06-08 2:14 Colin Ford
2001-06-08 2:16 ` Colin Ford
0 siblings, 1 reply; 3+ messages in thread
From: Colin Ford @ 2001-06-08 2:14 UTC (permalink / raw)
To: eCos
Hi,
does anyone know if redboots sprintf evaluates the
code below properly.
sprintf( buf, "%%%d%c", 5 );
I seem to get "?5c" when I was expecting "%5c" in buf?
Cheers,
Col.
--
===========================================
Colin Ford PipingHot Networks
Software Engineer +44 (0)1364 655510
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ECOS] sprintf problem in redboot?
2001-06-08 2:14 [ECOS] sprintf problem in redboot? Colin Ford
@ 2001-06-08 2:16 ` Colin Ford
2001-06-08 2:27 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: Colin Ford @ 2001-06-08 2:16 UTC (permalink / raw)
To: Colin Ford; +Cc: eCos
Sorry I ment
sprintf( buf, "%%%dc", 5 );
Cheers,
Col.
On 08 Jun 2001 10:14:05 +0100, Colin Ford wrote:
> Hi,
>
> does anyone know if redboots sprintf evaluates the
> code below properly.
>
> sprintf( buf, "%%%d%c", 5 );
>
> I seem to get "?5c" when I was expecting "%5c" in buf?
>
> Cheers,
> Col.
>
> --
> ===========================================
> Colin Ford PipingHot Networks
> Software Engineer +44 (0)1364 655510
--
===========================================
Colin Ford PipingHot Networks
Software Engineer +44 (0)1364 655510
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ECOS] sprintf problem in redboot?
2001-06-08 2:16 ` Colin Ford
@ 2001-06-08 2:27 ` Andrew Lunn
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2001-06-08 2:27 UTC (permalink / raw)
To: Colin Ford; +Cc: eCos
On Fri, Jun 08, 2001 at 10:15:23AM +0100, Colin Ford wrote:
No it does not support %%. The ? means it does not understand the
format string. Look in
packages/redboot/current/src/printf.c
It seems easy to fix through. Alternativly this should work:
sprintf( buf, "%c%dc", `%`,5);
Andrew
> Sorry I ment
>
> sprintf( buf, "%%%dc", 5 );
>
> Cheers,
> Col.
>
>
> On 08 Jun 2001 10:14:05 +0100, Colin Ford wrote:
> > Hi,
> >
> > does anyone know if redboots sprintf evaluates the
> > code below properly.
> >
> > sprintf( buf, "%%%d%c", 5 );
> >
> > I seem to get "?5c" when I was expecting "%5c" in buf?
> >
> > Cheers,
> > Col.
> >
> > --
> > ===========================================
> > Colin Ford PipingHot Networks
> > Software Engineer +44 (0)1364 655510
>
>
>
> --
> ===========================================
> Colin Ford PipingHot Networks
> Software Engineer +44 (0)1364 655510
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-06-08 2:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-08 2:14 [ECOS] sprintf problem in redboot? Colin Ford
2001-06-08 2:16 ` Colin Ford
2001-06-08 2:27 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).