static int sys_specified;
static char config_file[MAX_NAME_LEN] = SCSI_ID_CONFIG_FILE;
static int display_bus_id;
-static int default_page_code;
+static enum page_code default_page_code;
static int use_stderr;
static int debug;
static int hotplug_mode;
/* strip trailing whitespace */
len = strnlen(from, count);
- while (isspace(from[len-1]))
+ while (len && isspace(from[len-1]))
len--;
/* strip leading whitespace */
case 'p':
if (strcmp(optarg, "0x80") == 0) {
- default_page_code = 0x80;
+ default_page_code = PAGE_80;
} else if (strcmp(optarg, "0x83") == 0) {
- default_page_code = 0x83;
+ default_page_code = PAGE_83;
+ } else if (strcmp(optarg, "pre-spc3-83") == 0) {
+ default_page_code = PAGE_83_PRE_SPC3;
} else {
log_message(LOG_WARNING,
"Unknown page code '%s'\n", optarg);
case 'p':
if (strcmp(optarg, "0x80") == 0) {
- *page_code = 0x80;
+ *page_code = PAGE_80;
} else if (strcmp(optarg, "0x83") == 0) {
- *page_code = 0x83;
+ *page_code = PAGE_83;
+ } else if (strcmp(optarg, "pre-spc3-83") == 0) {
+ *page_code = PAGE_83_PRE_SPC3;
} else {
log_message(LOG_WARNING,
"Unknown page code '%s'\n", optarg);