blob: 699f9c5ce22d6aa90bc8cd3d64eb64a9fdec9c22 [file] [log] [blame] [edit]
/*
* Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
*
* SPDX-License-Identifier: MIT
*/
#include "aml_strnlen.h"
#if (1 == CONFIG_ARM64)
size_t strnlen(const char *s, size_t maxlen)
#else
int strnlen(const char *s, int maxlen)
#endif
{
const char *ss = s;
while ((maxlen > 0) && *ss) {
ss++;
maxlen--;
}
return ss - s;
}