The parsing code made some strange assumptions about what is a printer
name, and what is a comment.
has_punctuation = (strchr_m(p, ' ') ||
strchr_m(p, '\t') ||
+ strchr_m(p, '"') ||
+ strchr_m(p, '\'') ||
+ strchr_m(p, ';') ||
+ strchr_m(p, ',') ||
strchr_m(p, '(') ||
strchr_m(p, ')'));
continue;
}
- if (strlen(p) <= MAXPRINTERLEN &&
- strlen(p) > strlen(name) && !has_punctuation) {
+ if (strlen(p) <= MAXPRINTERLEN && *name == '\0' && !has_punctuation) {
if (!*comment) {
strlcpy(comment, name, sizeof(comment));
}
}
}
- comment[60] = 0;
- name[MAXPRINTERLEN] = 0;
-
if (*name && !pcap_cache_add(name, comment)) {
x_fclose(pcap_file);
goto done;