From 69099d84949a8044fdfc74e9d7ff6b9e57fc0bcd Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 1 Aug 2017 19:36:38 +0000 Subject: Flesh out libwpactrl --- src/libwpactrl/wpactrl_env_parse.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/libwpactrl/wpactrl_env_parse.c (limited to 'src/libwpactrl/wpactrl_env_parse.c') diff --git a/src/libwpactrl/wpactrl_env_parse.c b/src/libwpactrl/wpactrl_env_parse.c new file mode 100644 index 0000000..c722fd5 --- /dev/null +++ b/src/libwpactrl/wpactrl_env_parse.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +#include + +unsigned int wpactrl_env_parse (char *s, size_t len) +{ + size_t i = 0 ; + unsigned int n = 0 ; + for (; i < len ; i++) if (s[i] == '\n') (s[i] = 0, n++) ; + return n ; +} -- cgit v1.2.3