strlen.c 256 B

1234567891011121314151617
  1. /*
  2. * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <string.h>
  7. size_t strlen(const char *s)
  8. {
  9. const char *cursor = s;
  10. while (*cursor)
  11. cursor++;
  12. return cursor - s;
  13. }