MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / msh_isint

Function msh_isint

components/finsh/msh_parse.c:23–41  ·  view source on GitHub ↗

* This function will check integer. * * @param strvalue string * * @return true or false */

Source from the content-addressed store, hash-verified

21 * @return true or false
22 */
23rt_bool_t msh_isint(char *strvalue)
24{
25 if ((RT_NULL == strvalue) || ('\0' == strvalue[0]))
26 {
27 return RT_FALSE;
28 }
29 if (('+' == *strvalue) || ('-' == *strvalue))
30 {
31 strvalue++;
32 }
33 forstrloop(strvalue)
34 {
35 if (!isdigit((int)(*strvalue)))
36 {
37 return RT_FALSE;
38 }
39 }
40 return RT_TRUE;
41}
42
43/**
44 * This function will check hex.

Callers 3

_pin_cmd_modeFunction · 0.85
_pin_cmd_readFunction · 0.85
_pin_cmd_writeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected