MCPcopy Create free account
hub / github.com/buggins/coolreader / decodeDecimal

Function decodeDecimal

crengine/src/lvstring.cpp:886–897  ·  view source on GitHub ↗

decode LEN decimal digits, return decoded number, -1 if invalid

Source from the content-addressed store, hash-verified

884
885// decode LEN decimal digits, return decoded number, -1 if invalid
886int decodeDecimal( const lChar16 * str, int len ) {
887 int n = 0;
888 for ( int i=0; i<len; i++ ) {
889 if ( !str[i] )
890 return -1;
891 int d = str[i] - '0';
892 if ( d<0 || d>9 )
893 return -1;
894 n = n*10 + d;
895 }
896 return n;
897}
898
899bool lString16::atoi( int &n ) const
900{

Callers 1

processLineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected