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

Function rt_strncmp

src/klibc/kstring.c:438–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436 */
437#ifndef RT_KLIBC_USING_USER_STRNCMP
438rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_size_t count)
439{
440#ifdef RT_KLIBC_USING_LIBC_STRNCMP
441 return strncmp(cs, ct, count);
442#else
443 signed char res = 0;
444
445 while (count)
446 {
447 if ((res = *cs - *ct++) != 0 || !*cs++)
448 {
449 break;
450 }
451
452 count --;
453 }
454
455 return res;
456#endif /* RT_KLIBC_USING_LIBC_STRNCMP */
457}
458#endif /* RT_KLIBC_USING_USER_STRNCMP */
459RTM_EXPORT(rt_strncmp);
460

Callers 15

finsh_wait_authFunction · 0.85
lwp_name2pidFunction · 0.85
rt_raw_channel_openFunction · 0.85
sys_mountFunction · 0.85
_match_tty_iterFunction · 0.85
rt_bus_find_by_nameFunction · 0.85
ofw_parse_objectFunction · 0.85
rt_ofw_console_setupFunction · 0.85
rt_ofw_bootargs_selectFunction · 0.85
rt_ofw_node_tag_equFunction · 0.85
rt_ofw_node_tag_prefixFunction · 0.85

Calls

no outgoing calls

Tested by 4

uart_sample_v1Function · 0.68
uart_sample_v2Function · 0.68