openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/systemd/1_242+AUTOINC+db2e367bfc-r0/git/src/udev/scsi_id/scsi_serial.c
static int prepend_vendor_model(struct scsi_id_device* dev_scsi, char* serial)
{
    int ind;

    strncpy(serial, dev_scsi->vendor, VENDOR_LENGTH);
    strncat(serial, dev_scsi->model, MODEL_LENGTH);
    ind = strlen(serial);

    /*
     * This is not a complete check, since we are using strncat/cpy
     * above, ind will never be too large.
     */
    if (ind != (VENDOR_LENGTH + MODEL_LENGTH))
    {
        log_debug("%s: expected length %d, got length %d", dev_scsi->kernel,
                  (VENDOR_LENGTH + MODEL_LENGTH), ind);
        return -1;
    }
    return ind;
}
/*
 * The caller checks that serial is long enough to include the vendor +
 * model.
 */
The caller checks that serial is long enough to include the vendor +
model.
The caller checks that serial is long enough to include the vendor + model .
static int prepend_vendor_model(struct scsi_id_device* dev_scsi, char* serial)
{
    int ind;
    strncpy(serial, dev_scsi->vendor, VENDOR_LENGTH);
    strncat(serial, dev_scsi->model, MODEL_LENGTH);
    ind = strlen(serial);
    if (ind != (VENDOR_LENGTH + MODEL_LENGTH))
    {
        log_debug("%s: expected length %d, got length %d", dev_scsi->kernel,
                  (VENDOR_LENGTH + MODEL_LENGTH), ind);
        return -1;
    }
    return ind;
}
static int prepend_vendor_model ( struct scsi_id_device * dev_scsi , char * serial ) { int ind ; strncpy ( serial , dev_scsi -> vendor , VENDOR_LENGTH ) ; strncat ( serial , dev_scsi -> model , MODEL_LENGTH ) ; ind = strlen ( serial ) ; if ( ind != ( VENDOR_LENGTH + MODEL_LENGTH ) ) { log_debug ( " " , dev_scsi -> kernel , ( VENDOR_LENGTH + MODEL_LENGTH ) , ind ) ; return -1 ; } return ind ; }
The caller checks that serial is long enough to include the vendor +
 model.
The caller checks that serial is long enough to include the vendor + model .
/*
     * This is not a complete check, since we are using strncat/cpy
     * above, ind will never be too large.
     */