diff --git a/include/rigid_paradise/string.h b/include/rigid_paradise/string.h new file mode 100644 index 0000000..2073cc6 --- /dev/null +++ b/include/rigid_paradise/string.h @@ -0,0 +1,10 @@ +#pragma once +#include + + +namespace cstring{ + constexpr size_t strlen( const char* s ) noexcept + { + return *s ? 1 + strlen(s + 1) : 0; + } +} \ No newline at end of file diff --git a/src/yes/yes.cpp b/src/yes/yes.cpp index dd5e245..5af901d 100644 --- a/src/yes/yes.cpp +++ b/src/yes/yes.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #ifndef EXIT_FAILURE #define EXIT_FAILURE -1 @@ -17,7 +17,7 @@ usage: yes [STRING]*\n\ yes --help\n\ yes --version\n\ Display this text.\n"; -const size_t help_len = strlen(help); +const size_t help_len = cstring::strlen(help); int main(int argc, char** argv) {