ovidiucp / TinyWebServer

Small web server for Arduino, fits in 10KB ROM, less than 512 bytes RAM
http://www.webweavertech.com/ovidiu/weblog/archives/000484.html
GNU Lesser General Public License v2.1
245 stars 65 forks source link

Replacing strtoul #16

Closed m4rCsi closed 11 years ago

m4rCsi commented 11 years ago

Strtoul is used for parsing the hex string for url endcoding. This uses lots of program space, and quite a waste if you are not using it in other parts of the project.

By replacing it with a simple hextodec function I could save about 700k program memory in my project.

Mybe this is helpful to other people.

ovidiucp commented 11 years ago

I just tested the tolower() vs the if() statement I proposed. The if() adds 12 more bytes vs the tolower() version.