flyingfish89 opened a new pull request, #8495: URL: https://github.com/apache/nuttx/pull/8495
## Summary with the test of sim:lua ,I have fixed some bug of error output 1.input: " " and error output string is "NULL" 2.input: "1.2e+", error output string is "NULL" 3.input: "." error output string is "NULL" ## Impact ## Testing char *a = " n"; char *b; float number = strtof(a,&b); syslog(LOG_INFO,"string is %s\n number is %f and string is %s\n",a,number,b); a = " 10 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "2nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = " 3e0 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "1.0e+nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "2 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "2nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "-2 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\nnumber is %f and string is %s\n",a,number,b); a = " -0xa nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\n number is %f and string is %s\n",a,number,b); a = "+0.01 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\nnumber is %f and string is %s\n",a,number,b); a = "+.01 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\nnumber is %f and string is %s\n",a,number,b); a = ".01 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\nnumber is %f and string is %s\n",a,number,b); a = "-1. nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\nnumber is %f and string is %s\n",a,number,b); a = "+1. nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\nnumber is %f and string is %s\n",a,number,b); a = "+ 0.01 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"astring is %s\nnumber is %f and string is %s\n",a,number,b); a = "+.e1 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "1e nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "1.0e+ nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = ". nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "nan"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "-012 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "-1.2e2 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "e1 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0xffffffffffff nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "x"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0xffffffffffff nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0x3. nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0x0. nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "-0xfFfa nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0xffffFFFF nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0x.0p-3"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0ffffFFFF nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "+0x2 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "-0xaA nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "-0xffFFFfff nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0E+1 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0E+1 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0xe-1 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = " 0x2.5 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = " -0x2.5 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0x0.51p nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0x.00000001 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0xA.a nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0xa.aP4 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0x4P-2 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0x1.1 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "1. nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = ".1 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "0.001e+3 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "1111111111111110 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "1111111111111111 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "+1.23E18 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = " 1.3e-2 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = " -1.00000000000001 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "10 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); a = "20 nsh"; number = strtof(a,&b); syslog(LOG_INFO,"string is %s\nnumber is %f and string is %s\n",a,number,b); -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org