summaryrefslogtreecommitdiffstats
path: root/bstrlen.c
diff options
context:
space:
mode:
authorSimon Rettberg2014-03-15 01:49:50 +0100
committerSimon Rettberg2014-03-15 01:49:50 +0100
commitbedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad (patch)
treec7d1995a09f6ed0c4e6873252e957d72f5d07d07 /bstrlen.c
downloadldadp-bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad.tar.gz
ldadp-bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad.tar.xz
ldadp-bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad.zip
Lean and mean initial commit
Not much functionality yet
Diffstat (limited to 'bstrlen.c')
-rw-r--r--bstrlen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bstrlen.c b/bstrlen.c
new file mode 100644
index 0000000..61825d5
--- /dev/null
+++ b/bstrlen.c
@@ -0,0 +1,8 @@
+#include <string.h>
+#include "bstr.h"
+#include "uint32.h"
+#include "str.h"
+
+size_t bstrlen(const char* a) {
+ if (*a) return str_len(a); else return uint32_read(a+1);
+}