remove unused variable and add const
This commit is contained in:
parent
40fa19002a
commit
998560634e
3 changed files with 2 additions and 4 deletions
|
@ -24,7 +24,7 @@ char * inside_slug(const char * needle, int needle_len, char *offset);
|
||||||
|
|
||||||
char * ltrim_slash(char* str);
|
char * ltrim_slash(char* str);
|
||||||
|
|
||||||
void str_repeat(char *s, char *c, int len);
|
void str_repeat(char *s, const char *c, int len);
|
||||||
|
|
||||||
void print_indent(int level);
|
void print_indent(int level);
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ char * ltrim_slash(char* str)
|
||||||
return zstrdup(p);
|
return zstrdup(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void str_repeat(char *s, char *c, int len) {
|
void str_repeat(char *s, const char *c, int len) {
|
||||||
while(len--) {
|
while(len--) {
|
||||||
s[len - 1] = *c;
|
s[len - 1] = *c;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,6 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_inside_slug)
|
START_TEST (test_inside_slug)
|
||||||
{
|
{
|
||||||
int slug_len = 0;
|
|
||||||
char * pattern = "/user/{name:\\s+}/to/{id}";
|
char * pattern = "/user/{name:\\s+}/to/{id}";
|
||||||
char * offset = strchr(pattern, '{') + 2;
|
char * offset = strchr(pattern, '{') + 2;
|
||||||
ck_assert( (int)inside_slug(pattern, strlen(pattern), offset) );
|
ck_assert( (int)inside_slug(pattern, strlen(pattern), offset) );
|
||||||
|
@ -85,7 +84,6 @@ END_TEST
|
||||||
|
|
||||||
START_TEST (test_slug_count)
|
START_TEST (test_slug_count)
|
||||||
{
|
{
|
||||||
int slug_len = 0;
|
|
||||||
char * pattern = "/user/{name:\\s+}/to/{id}";
|
char * pattern = "/user/{name:\\s+}/to/{id}";
|
||||||
ck_assert_int_eq( slug_count(pattern, strlen(pattern) ), 2 );
|
ck_assert_int_eq( slug_count(pattern, strlen(pattern) ), 2 );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue