diff options
author | Matt Fleming <matt.fleming@linux.intel.com> | 2011-07-13 14:03:52 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@linux.intel.com> | 2011-07-28 12:21:29 +0100 |
commit | 4519d010a4f8129b6bda73c223a0e25484c00a91 (patch) | |
tree | f17b75c176f6bc1dc6e83c3174fcc0fb65599f63 | |
parent | 6c181c367cea186c748be819d31d98e4b0aaab17 (diff) | |
download | efilinux-4519d010a4f8129b6bda73c223a0e25484c00a91.tar.gz |
stdlib.h: Add strlen implementation
While gnu-efi provides a strlen implementation for Unicode strings, we
also need one for char *.
Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
-rw-r--r-- | stdlib.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -20,4 +20,16 @@ static inline void memcpy(char *dst, char *src, UINTN size) *dst++ = *src++; } +static inline int strlen(char *str) +{ + int len; + + len = 0; + while (*str++) + len++; + + return len; +} + + #endif /* __STDLIB_H__ */ |