summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-03-10 13:04:25 +0800
committerGitHub <[email protected]>2019-03-10 13:04:25 +0800
commit6a12704bc6a5ca96a18c15bb6cea0787b8d81e12 (patch)
tree43ed5527841760339e3883d393ec44c376a957b8 /src
parent1cf890c1bf73558ff9b129fa64d4e11689e1bef7 (diff)
parent584593071eac32ea7e65eedd81a36a1326bbbfe1 (diff)
Merge pull request #2412 from armink/fix_ulog
Update the ulog
Diffstat (limited to 'src')
-rw-r--r--src/kservice.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/kservice.c b/src/kservice.c
index b640107a33..3663766225 100644
--- a/src/kservice.c
+++ b/src/kservice.c
@@ -461,6 +461,7 @@ rt_int32_t rt_strcmp(const char *cs, const char *ct)
return (*cs - *ct);
}
RTM_EXPORT(rt_strcmp);
+
/**
* The strnlen() function returns the number of characters in the
* string pointed to by s, excluding the terminating null byte ('\0'),
@@ -476,11 +477,13 @@ rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen)
{
const char *sc;
- for (sc = s; *sc != '\0' && sc - s < (int)maxlen; ++sc) /* nothing */
+ for (sc = s; *sc != '\0' && (rt_ubase_t)(sc - s) < maxlen; ++sc) /* nothing */
;
return sc - s;
}
+RTM_EXPORT(rt_strnlen);
+
/**
* This function will return the length of a string, which terminate will
* null character.