vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Han Boetes wrote: > A friend of mine, when I asked him about conversions, mentioned he > 'simply used snprintf.' He simply let the conversions of the printf > family work out the problem. And if the conversion failed snprintf > returned a proper error. I presume that you mean sscanf and not snprintf, because we are talking about conversion and parsing, not formatting. sscanf is a dangerous API, because it encourages people to encode the field widths for strings into the format string. So, when the field widths change and the format string doesn't (or vice versa), you have either a parsing bug or an overflow. Even if this was not a problem, sscanf *still* isn't as convenient as strtonum(). -d |