version 1.19, 2016/09/17 15:06:41 |
version 1.20, 2017/01/04 16:27:01 |
|
|
|
|
if (*s == '*') { /* skip leading attribute if there */ |
if (*s == '*') { /* skip leading attribute if there */ |
s++; |
s++; |
if (strchr("dksu", *s) == NULL) { |
if (*s == '\0' || strchr("dksu", *s) == NULL) { |
return (-1); |
return (-1); |
} |
} |
s++; |
s++; |
|
|
if (seen) { |
if (seen) { |
return (-1); /* 2nd % format item! */ |
return (-1); /* 2nd % format item! */ |
} |
} |
while (strchr(" '+-0#", *s) != NULL) { /* skip flags */ |
/* skip flags */ |
|
while (*s != '\0' && strchr(" '+-0#", *s) != NULL) { |
s++; |
s++; |
} |
} |
while (isdigit(*s)) { /* skip width */ |
while (isdigit(*s)) { /* skip width */ |
|
|
s++; |
s++; |
} |
} |
|
|
if (strchr("cCdiouxX", *s) == NULL) { |
if (*s == '\0' || strchr("cCdiouxX", *s) == NULL) { |
/* bad or evil format character (%s, %n, etc.) */ |
/* bad or evil format character (%s, %n, etc.) */ |
return (-1); |
return (-1); |
} |
} |