mirror of
https://github.com/curl/curl.git
synced 2026-08-25 15:13:41 +03:00
curl_fnmatch, servers: drop local macros in favour of sizeof()
Closes #17898
This commit is contained in:
parent
0260e8465a
commit
8ae93a95f8
3 changed files with 21 additions and 25 deletions
|
|
@ -74,14 +74,13 @@ typedef enum {
|
|||
static int parsekeyword(const unsigned char **pattern, unsigned char *charset)
|
||||
{
|
||||
parsekey_state state = CURLFNM_PKW_INIT;
|
||||
#define KEYLEN 10
|
||||
char keyword[KEYLEN] = { 0 };
|
||||
int i;
|
||||
char keyword[10] = { 0 };
|
||||
size_t i;
|
||||
const unsigned char *p = *pattern;
|
||||
bool found = FALSE;
|
||||
for(i = 0; !found; i++) {
|
||||
char c = (char)*p++;
|
||||
if(i >= KEYLEN)
|
||||
if(i >= sizeof(keyword))
|
||||
return SETCHARSET_FAIL;
|
||||
switch(state) {
|
||||
case CURLFNM_PKW_INIT:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue