Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Current wps.c

Re: Current wps.c

From: Justin Heiner <jheiner_at_yahoo.com>
Date: Fri, 30 Aug 2002 10:26:03 -0700 (PDT)

My reasoning behind using the "%s","xxxx" is just for readability purposes.
It's easier to edit and update when you don't have to worry about typing %%
instead of %, especially if someone uses the WPS tag %%, which would have to be
written %%%% :-)

-Justin

--- Magnus Holmgren <lear_at_algonet.se> wrote:
> Hi,
>
> Don't know if this has been discussed, but there's one small detail about the
> current code in wps.c that bugs me: "misuse" of snprintf.
>
> The "problem" is lines like these:
>
> snprintf(wps_display[l],sizeof(wps_display[l]),"%s","%fn");
>
> Two things:
>
> 1) What's wrong with strcpy (or strncpy)?
> 2) You can get a "%" in the buffer by using "%%" in the format string.
>
> (Don't take this the wrong way; it's meant as constructive critisism of what
> is really a minor detail.)
>
> :)
>
> Magnus
>


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Received on 2002-08-30

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy