delorie.com/archives/browse.cgi | search |
> no, this saves execution time rather than calling strlen OVER and OVER > on the same constant strings. We could compute it once and then cache > those values, but geez, that's ugly. Ok, never mind then. > Is printf ("%s\n", __FUNCTION__); okay ? If so, done. Yup. > ret = snprintf (fixup_name, buffer_len, "__fu%d_%s", > counter++, sym->name); Sorry, can't use snprintf. Use strlen every time (figure 20 for the counter) and compare to the max length. Round up to a multiple of 100 to reduce heap fragmentation. Then use regular sprintf.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |