chiark / gitweb /
extras/keymap: teach findkeyboards about USB keyboards
[elogind.git] / extras / scsi_id / scsi_serial.c
index cbacf379fee8cff055b9d44d01792837eb222159..4248829180b36475f519f775d3377a19a16d2033 100644 (file)
@@ -30,7 +30,8 @@
 /* #include <linux/bsg.h> */
 #include "bsg.h"
 
-#include "../../udev/udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
 #include "scsi.h"
 #include "scsi_id.h"
 
@@ -456,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
@@ -469,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;
 }
@@ -772,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;
        }
        /*