const fix

This commit is contained in:
c9s 2014-06-03 22:20:54 +08:00
parent 2aa3509845
commit 23cfbe167f
3 changed files with 5 additions and 5 deletions

View file

@ -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 {

View file

@ -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;

View file

@ -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);