[mc1322x] "atoi" oversize

Ian Martin martini at alum.mit.edu
Fri Jul 2 14:24:21 EDT 2010


On Fri, Jul 2, 2010 at 10:01 AM, Daniel Berenguer
<dberenguer at usapiens.com> wrote:
> I'm currently writing a simple contiki-based application where the use
> of "atoi" is making the code grow from 59 KB to 487 KB !!

In case you just want a quick fix:

int atoi_tiny(const char* a) {
	int i = 0;
	for (; (*a >= '0') && (*a <= '9'); a++)
		i = 10 * i + (*a - '0');
	return i;
}

-Ian



More information about the mc1322x mailing list