Bug #1964 » 0007-Fix-compilation-against-glibc-2.43.patch
| utility/log.c | ||
|---|---|---|
|
}
|
||
|
do {
|
||
|
struct log_fileinfo *pfile = log_files + i;
|
||
|
char *d = strchr(tok, ',');
|
||
|
const char *dtmp = strchr(tok, ',');
|
||
|
pfile->min = 0;
|
||
|
pfile->max = 0;
|
||
|
pfile->level = level;
|
||
|
if (d) {
|
||
|
char *pc = d + 1;
|
||
|
if (dtmp) {
|
||
|
char *d, *dm;
|
||
|
char *pc;
|
||
|
d[0] = '\0';
|
||
|
d = strchr(d + 1, ',');
|
||
|
dm = fc_malloc(strlen(dtmp) + 1);
|
||
|
strcpy(dm, dtmp);
|
||
|
pc = dm + 1;
|
||
|
dm[0] = '\0';
|
||
|
d = strchr(dm + 1, ',');
|
||
|
if (d && *pc != '\0' && d[1] != '\0') {
|
||
|
d[0] = '\0';
|
||
|
if (!str_to_uint(pc, &pfile->min)) {
|
||
| ... | ... | |
|
goto out;
|
||
|
}
|
||
|
}
|
||
|
free(dm);
|
||
|
}
|
||
|
if (strlen(tok) == 0) {
|
||
|
fc_fprintf(stderr, _("Empty filename in log level argument \"%s\".\n"),
|
||
| utility/shared.c | ||
|---|---|---|
|
****************************************************************************/
|
||
|
char scanin(const char **buf, char *delimiters, char *dest, int size)
|
||
|
{
|
||
|
char *ptr, found = '?';
|
||
|
char found = '?';
|
||
|
bool sf = FALSE;
|
||
|
if (*buf == NULL || strlen(*buf) == 0 || size == 0) {
|
||
|
if (dest) {
|
||
| ... | ... | |
|
}
|
||
|
if (dest) {
|
||
|
char *ptr;
|
||
|
strncpy(dest, *buf, size-1);
|
||
|
dest[size-1] = '\0';
|
||
|
dest[size - 1] = '\0';
|
||
|
remove_leading_trailing_spaces(dest);
|
||
|
ptr = strpbrk(dest, delimiters);
|
||
|
if (ptr != NULL) {
|
||
|
found = *ptr;
|
||
|
*ptr = '\0';
|
||
|
remove_leading_trailing_spaces(dest);
|
||
|
sf = TRUE;
|
||
|
}
|
||
|
} else {
|
||
|
const char *ptr;
|
||
|
/* Just skip ahead. */
|
||
|
ptr = strpbrk(*buf, delimiters);
|
||
|
}
|
||
|
if (ptr != NULL) {
|
||
|
found = *ptr;
|
||
|
if (dest) {
|
||
|
*ptr = '\0';
|
||
|
}
|
||
|
if (dest) {
|
||
|
remove_leading_trailing_spaces(dest);
|
||
|
if (ptr != NULL) {
|
||
|
found = *ptr;
|
||
|
sf = TRUE;
|
||
|
}
|
||
|
}
|
||
|
if (sf) {
|
||
|
*buf = strpbrk(*buf, delimiters);
|
||
|
if (*buf != NULL) {
|
||
|
(*buf)++; /* Skip delimiter */
|
||
- « Previous
- 1
- 2
- Next »