remove uhtbl - i don't think we will need it
[project/libubox.git] / blob.c
diff --git a/blob.c b/blob.c
index cafd74c..003192e 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -132,9 +132,9 @@ static const int blob_type_minlen[BLOB_ATTR_LAST] = {
 };
 
 bool
-blob_check_type(void *ptr, int len, int type)
+blob_check_type(const void *ptr, int len, int type)
 {
-       char *data = ptr;
+       const char *data = ptr;
 
        if (type >= BLOB_ATTR_LAST)
                return false;
@@ -147,7 +147,7 @@ blob_check_type(void *ptr, int len, int type)
                        return false;
        }
 
-       if (type == BLOB_ATTR_STRING && data[len] != 0)
+       if (type == BLOB_ATTR_STRING && data[len - 1] != 0)
                return false;
 
        return true;