@@ -59,14 +59,11 @@ static struct flb_input_instance *find_input(struct flb_hs *hs, const char *name
59
59
60
60
mk_list_foreach (head , & hs -> config -> inputs ) {
61
61
in = mk_list_entry (head , struct flb_input_instance , _head );
62
- if (strlen (in -> name ) != nlen ) {
63
- continue ;
64
- }
65
- if (strncmp (name , in -> name , nlen ) == 0 ) {
62
+ if ((strlen (in -> name ) == nlen ) && (strncmp (name , in -> name , nlen ) == 0 )) {
66
63
return in ;
67
64
}
68
65
if (in -> alias ) {
69
- if (strcmp ( name , in -> alias ) == 0 ) {
66
+ if (( strlen ( in -> alias ) == nlen ) && ( strncmp ( name , in -> alias , nlen ) == 0 ) ) {
70
67
return in ;
71
68
}
72
69
}
@@ -113,7 +110,7 @@ static int disable_trace_input(struct flb_hs *hs, const char *name, size_t nlen)
113
110
114
111
static flb_sds_t get_input_name (mk_request_t * request )
115
112
{
116
- const char * base = "/api/v1/trace/" ;
113
+ const char base [] = "/api/v1/trace/" ;
117
114
118
115
119
116
if (request -> real_path .data == NULL ) {
@@ -124,7 +121,7 @@ static flb_sds_t get_input_name(mk_request_t *request)
124
121
}
125
122
126
123
return flb_sds_create_len (& request -> real_path .data [sizeof (base )- 1 ],
127
- request -> real_path .len - sizeof (base )- 1 );
124
+ request -> real_path .len - ( sizeof (base )- 1 ) );
128
125
}
129
126
130
127
static int http_disable_trace (mk_request_t * request , void * data ,
0 commit comments