Skip to content

Instantly share code, notes, and snippets.

@jasom
Created September 22, 2015 02:03
Show Gist options
  • Save jasom/b3cb5118e9e2efab3a5f to your computer and use it in GitHub Desktop.
Save jasom/b3cb5118e9e2efab3a5f to your computer and use it in GitHub Desktop.
Proposed bstring fix
diff --git a/src/bstring.h b/src/bstring.h
index 70a9e4e..4f77726 100644
--- a/src/bstring.h
+++ b/src/bstring.h
@@ -37,5 +37,9 @@
#include <bstr/bstrlib.h>
#include <bstr/bstraux.h>
+#undef blength
+#undef bdata
+static inline int blength(bstring b) { return blengthe(b,0); }
+static inline char *bdata(bstring b) { return bdataofs (b,0); }
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment