diff --git a/src/node.c b/src/node.c index 956ae82..39f9cf8 100644 --- a/src/node.c +++ b/src/node.c @@ -516,8 +516,8 @@ edge * r3_node_find_common_prefix(node *n, const char *path, int path_len, int * if (prefix > 0) { r3_slug_t *slug; int ret = 0; - char *offset = (char*) path; - char *p = ((char*)path) + prefix; + const char *offset = (char*) path; + const char *p = ((char*)path) + prefix; slug = r3_slug_new(path, path_len); @@ -532,7 +532,7 @@ edge * r3_node_find_common_prefix(node *n, const char *path, int path_len, int * } else if ( p < slug->begin ) { break; } else if ( p >= slug->end && p < (path + path_len) ) { - offset = (char*) slug->end + 1; + offset = slug->end + 1; prefix = p - path; continue; } else { diff --git a/src/slug.c b/src/slug.c index cd62b16..804c89e 100644 --- a/src/slug.c +++ b/src/slug.c @@ -76,7 +76,7 @@ Return 1 => Slug found Return -1 => Slug parsing error */ -int r3_slug_parse(r3_slug_t *s, const char *needle, int needle_len, char *offset, char **errstr) { +int r3_slug_parse(r3_slug_t *s, const char *needle, int needle_len, const char *offset, char **errstr) { s->path = (char*) needle; s->path_len = needle_len; diff --git a/src/slug.h b/src/slug.h index 14db6c2..7511125 100644 --- a/src/slug.h +++ b/src/slug.h @@ -43,7 +43,7 @@ r3_slug_t * r3_slug_new(const char * path, int path_len); int r3_slug_check(r3_slug_t *s); -int r3_slug_parse(r3_slug_t *s, const char *needle, int needle_len, char *offset, char **errstr); +int r3_slug_parse(r3_slug_t *s, const char *needle, int needle_len, const char *offset, char **errstr); char * r3_slug_to_str(const r3_slug_t *s);