summaryrefslogtreecommitdiff
path: root/lib/strlen.c
blob: 4687a8a294dc3aa93687e8f6f4602d3df1ea75ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
** @file	strlen.c
**
** @author	Numerous CSCI-452 classes
**
** @brief	C implementations of common library functions
*/

#ifndef STRLEN_SRC_INC
#define STRLEN_SRC_INC

#include <common.h>

#include <lib.h>

/**
** strlen(str) - return length of a NUL-terminated string
**
** @param str The string to examine
**
** @return The length of the string, or 0
*/
uint32_t strlen(register const char *str)
{
	register uint32_t len = 0;

	while (*str++) {
		++len;
	}

	return (len);
}
#endif