int ind;
strncpy(serial, dev_scsi->vendor, VENDOR_LENGTH);
- ind = strlen(serial) - 1;
-
strncat(serial, dev_scsi->model, MODEL_LENGTH);
- ind = strlen(serial) - 1;
- ind++;
+ ind = strlen(serial);
/*
* This is not a complete check, since we are using strncat/cpy
if (ind != (VENDOR_LENGTH + MODEL_LENGTH)) {
info(udev, "%s: expected length %d, got length %d\n",
dev_scsi->kernel, (VENDOR_LENGTH + MODEL_LENGTH), ind);
- return 1;
+ return -1;
}
return ind;
}
len = 1 + VENDOR_LENGTH + MODEL_LENGTH + buf[3];
if (max_len < len) {
info(udev, "%s: length %d too short - need %d\n",
- dev_scsi->kernel, max_len, len);
+ dev_scsi->kernel, max_len, len);
return 1;
}
/*