[RFC/PATCH v2] stdio: implement assignment-allocation "m" character

Mike Frysinger vapier at gentoo.org
Tue May 22 02:21:34 UTC 2012


On Sunday 06 May 2012 04:13:55 Mike Frysinger wrote:
> The latest POSIX spec introduces a "m" character to allocate buffers for
> the user when using scanf type functions.  This is like the old glibc "a"
> flag, but now standardized.  With packages starting to use these, we need
> to implement it.
> 
> for example:
> 	char *s;
> 	sscanf("foo", "%ms", &s);
> 	printf("%s\n", s);
> 	free(s);
> This will automatically allocate storage for "s", read in "foo" to it,
> and then display it.
> 
> I'm not terribly familiar with the stdio layer, so this could be wrong.
> But it seems to work for me.

well, can't be worse than what we have today (no %m support), so pushed out!
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20120521/f6dac908/attachment.asc>


More information about the uClibc mailing list