Skip to content

Commit 69720f1

Browse files
author
Arto Kinnunen
committed
Use macro for isdigit
1 parent 22c3c35 commit 69720f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

features/nanostack/nanostack-interface/Nanostack.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#define TRACE_DEEP(...)
4545
#endif
4646

47+
#define NANOSTACK_ISDIGIT(c) ((c) >= '0' && (c) <= '9')
48+
4749
#define NS_INTERFACE_SOCKETS_MAX 16 //same as NanoStack SOCKET_MAX
4850

4951
#define MALLOC ns_dyn_mem_alloc
@@ -175,7 +177,7 @@ static int8_t nanostack_interface_id_parse(const char *interface_name)
175177
return -1;
176178
}
177179

178-
if ((strncmp("MES", interface_name, 3) == 0) && isdigit(interface_name[3])) {
180+
if ((strncmp("MES", interface_name, 3) == 0) && NANOSTACK_ISDIGIT(interface_name[3])) {
179181
interface_id = atoi(&interface_name[3]);
180182
}
181183

0 commit comments

Comments
 (0)