fix bug in stringInsertBytesAtMaybeAlloc()
This commit is contained in:
@@ -149,6 +149,13 @@ fn u64 u64SafeMul(u64 x, u64 y) {
|
||||
fn f32 f32FromString(String s) {
|
||||
f32 result = 0.0f;
|
||||
if (s.length == 0) { return result; }
|
||||
// TODO handle +/- for sign
|
||||
/*
|
||||
* while (*s == ' ') s++;
|
||||
float sign = 1.0f;
|
||||
if (*s == '-') { sign = -1.0f; s++; }
|
||||
else if (*s == '+') s++;
|
||||
* */
|
||||
ptr c = s.bytes;
|
||||
while (*c >= '0' && *c <= '9') {
|
||||
result = result * 10.0f + (*c++ - '0');
|
||||
|
||||
Reference in New Issue
Block a user