[Toybox] [New Toy] - printf

Ashwini Sharma ak.ashwini1981 at gmail.com
Mon Apr 7 06:22:22 PDT 2014


Hello Rob, List,

An implementation of __printf__ is attached.
Would love to have your inputs on the same.

__PATCH__:

An issue in ifconfig while verifying the HW Address, which is assumed
to be of the format __C2:79:38:95:CD:AB__ but can be of form
__C2:79:38:95:D:A__. In this case the HW address is reported as bad.

         if (*hw_addr == ':') hw_addr++;
         sscanf(hw_addr, "%2x%n", &val, &len);
-        if (len != 2) break;
+        if (!len || len > 2) break; // 1 nibble can be set e.g.
C2:79:38:95:D:A
         hw_addr += len;
         *p++ = val;

patch for same is attached.

regards,
Ashwini

PS: A reminder again!! about the commands lost in mailing list.
__getty__ and __modprobe__ implementations are still hanging around in
there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140407/f12352d3/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: printf.c
Type: text/x-csrc
Size: 7183 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140407/f12352d3/attachment-0005.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifconfig.c.patch
Type: application/octet-stream
Size: 406 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140407/f12352d3/attachment-0005.obj>


More information about the Toybox mailing list