From 55acd6957e5ae3d9916b39e57a8a4e52ad720fd1 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 16 Aug 2017 16:45:57 -0700 Subject: [PATCH] common: Use SVr4/4.3BSD/C89/C99 prototype for strlen SVr4/4.3BSD/C89/C99 use a return value of size_t. To make interaction with code running on both userland and on the EC easier, change our function prototype to return size_t as well. Signed-off-by: Stefan Reinauer BRANCH=none BUG=none TEST=make buildall -j works Change-Id: I0f097c4d0db4232d888e1d54e6c1d22f4859a112 Reviewed-on: https://chromium-review.googlesource.com/618269 Commit-Ready: Stefan Reinauer Tested-by: Stefan Reinauer Reviewed-by: Vincent Palatin --- common/util.c | 2 +- include/util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/util.c b/common/util.c index bc4001ee22..a353c75a61 100644 --- a/common/util.c +++ b/common/util.c @@ -7,7 +7,7 @@ #include "util.h" -int strlen(const char *s) +size_t strlen(const char *s) { int len = 0; diff --git a/include/util.h b/include/util.h index a2395674e9..bf3405728a 100644 --- a/include/util.h +++ b/include/util.h @@ -70,7 +70,7 @@ void *memmove(void *dest, const void *src, size_t len); void *memchr(const void *buffer, int c, size_t n); int strcasecmp(const char *s1, const char *s2); int strncasecmp(const char *s1, const char *s2, size_t size); -int strlen(const char *s); +size_t strlen(const char *s); size_t strnlen(const char *s, size_t maxlen); char *strncpy(char *dest, const char *src, size_t n); int strncmp(const char *s1, const char *s2, size_t n);