chiark / gitweb /
udev-acl: add joystick devices
[elogind.git] / extras / scsi_id / scsi_serial.c
index c47712d859e0c513c0c8e55ecc5d3b89713d5d4d..4248829180b36475f519f775d3377a19a16d2033 100644 (file)
@@ -457,11 +457,8 @@ static int prepend_vendor_model(struct udev *udev,
        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
@@ -470,7 +467,7 @@ static int prepend_vendor_model(struct udev *udev,
        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;
 }
@@ -773,7 +770,7 @@ static int do_scsi_page80_inquiry(struct udev *udev,
        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;
        }
        /*