[En-Nut-Discussion] printf/putf %S for string in flash?
Damian Slee
damian at commtech.com.au
Fri Oct 17 06:10:47 CEST 2003
Hi,
I have added support for '%S', strings from FLASH to my crt\putf.c. Should this be added to sourceforge?
Limitation is that it uses buf[BUF] to copy the string to memory. Which is maximum 16 bytes, or 15 characters.
...
case 'S':
cp = va_arg(ap, char *);
if (cp == 0)
goto putf_s;
memcpy_P(buf,cp, BUF); /* only support upto max size of buf */
buf[BUF-1] = 0; /* nul terminate if string was longer */
cp = buf;
goto putf_s;
case 's':
cp = va_arg(ap, char *);
putf_s:
...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: putf.zip
Type: application/x-zip-compressed
Size: 3891 bytes
Desc: putf.zip
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20031017/18ebd694/attachment-0001.bin>
More information about the En-Nut-Discussion
mailing list