strlen
This commit is contained in:
parent
4da76c0f3c
commit
3981746d2a
2
Makefile
2
Makefile
|
@ -4,7 +4,7 @@ CFLAGS=-Ilib83 -c -mz80 --std-sdcc2x --no-std-crt0 --reserve-regs-iy --opt-code-
|
||||||
|
|
||||||
OBJS=_crt0.rel clrscr.rel putchar.rel puts.rel exit.rel gotoxy.rel __assert_fail.rel \
|
OBJS=_crt0.rel clrscr.rel putchar.rel puts.rel exit.rel gotoxy.rel __assert_fail.rel \
|
||||||
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel memcmp.rel \
|
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel memcmp.rel \
|
||||||
strcpy.rel \
|
strcpy.rel strlen.rel \
|
||||||
main.rel
|
main.rel
|
||||||
|
|
||||||
.PHONY: all clean try
|
.PHONY: all clean try
|
||||||
|
|
9
lib83/strlen.c
Normal file
9
lib83/strlen.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
size_t strlen (const char * str) {
|
||||||
|
register size_t i = 0;
|
||||||
|
while(*str++) i++;
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user