add optional length to parseInt() and set result on success, remove unused stuff, avoid reading beyond eof, check divisor in StringDataField::derive(), fix for NumberDataField::writeSymbols()

This commit is contained in:
john30
2014-11-22 08:33:11 +01:00
parent b3a96cc2c0
commit 25196e4852
2 changed files with 21 additions and 17 deletions
Regular → Executable
+2 -1
View File
@@ -71,8 +71,9 @@ typedef struct {
* @param minValue the minimum resulting value.
* @param maxValue the maximum resulting value.
* @param result the variable in which to store an error code when parsing failed or the value is out of bounds.
* @param length the optional variable in which to store the number of read characters.
*/
unsigned int parseInt(const char* str, int base, const unsigned int minValue, const unsigned int maxValue, result_t& result);
unsigned int parseInt(const char* str, int base, const unsigned int minValue, const unsigned int maxValue, result_t& result, unsigned int* length=NULL);
class SingleDataField;