summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-10-06 01:10:59 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-10-06 01:10:59 +0200
commit0bbe8838e75bf97792d61b33f8592a32f1fc8bd4 (patch)
treeed9c94996deef6d333599c022298828427b3d1cd /extras
parent289a1821a4a7636ce42a6c7adc3a9bb49421a5ea (diff)
libudev: export udev_util_encode_string()
Diffstat (limited to 'extras')
-rw-r--r--extras/ata_id/ata_id.c12
-rw-r--r--extras/scsi_id/scsi_id.c24
2 files changed, 18 insertions, 18 deletions
diff --git a/extras/ata_id/ata_id.c b/extras/ata_id/ata_id.c
index cadadfc27f..e38a7d1aa5 100644
--- a/extras/ata_id/ata_id.c
+++ b/extras/ata_id/ata_id.c
@@ -547,12 +547,12 @@ int main(int argc, char *argv[])
memcpy (model, id.model, 40);
model[40] = '\0';
udev_util_encode_string(model, model_enc, sizeof(model_enc));
- udev_util_replace_whitespace((char *) id.model, model, 40);
- udev_util_replace_chars(model, NULL);
- udev_util_replace_whitespace((char *) id.serial_no, serial, 20);
- udev_util_replace_chars(serial, NULL);
- udev_util_replace_whitespace((char *) id.fw_rev, revision, 8);
- udev_util_replace_chars(revision, NULL);
+ util_replace_whitespace((char *) id.model, model, 40);
+ util_replace_chars(model, NULL);
+ util_replace_whitespace((char *) id.serial_no, serial, 20);
+ util_replace_chars(serial, NULL);
+ util_replace_whitespace((char *) id.fw_rev, revision, 8);
+ util_replace_chars(revision, NULL);
if (export) {
/* Set this to convey the disk speaks the ATA protocol */
diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c
index c14d411841..26b92e3fcd 100644
--- a/extras/scsi_id/scsi_id.c
+++ b/extras/scsi_id/scsi_id.c
@@ -510,13 +510,13 @@ static int set_inq_values(struct udev *udev, struct scsi_id_device *dev_scsi, co
udev_util_encode_string(dev_scsi->vendor, vendor_enc_str, sizeof(vendor_enc_str));
udev_util_encode_string(dev_scsi->model, model_enc_str, sizeof(model_enc_str));
- udev_util_replace_whitespace(dev_scsi->vendor, vendor_str, sizeof(vendor_str));
- udev_util_replace_chars(vendor_str, NULL);
- udev_util_replace_whitespace(dev_scsi->model, model_str, sizeof(model_str));
- udev_util_replace_chars(model_str, NULL);
+ util_replace_whitespace(dev_scsi->vendor, vendor_str, sizeof(vendor_str));
+ util_replace_chars(vendor_str, NULL);
+ util_replace_whitespace(dev_scsi->model, model_str, sizeof(model_str));
+ util_replace_chars(model_str, NULL);
set_type(dev_scsi->type, type_str, sizeof(type_str));
- udev_util_replace_whitespace(dev_scsi->revision, revision_str, sizeof(revision_str));
- udev_util_replace_chars(revision_str, NULL);
+ util_replace_whitespace(dev_scsi->revision, revision_str, sizeof(revision_str));
+ util_replace_chars(revision_str, NULL);
return 0;
}
@@ -560,11 +560,11 @@ static int scsi_id(struct udev *udev, char *maj_min_dev)
printf("ID_REVISION=%s\n", revision_str);
printf("ID_TYPE=%s\n", type_str);
if (dev_scsi.serial[0] != '\0') {
- udev_util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
- udev_util_replace_chars(serial_str, NULL);
+ util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
+ util_replace_chars(serial_str, NULL);
printf("ID_SERIAL=%s\n", serial_str);
- udev_util_replace_whitespace(dev_scsi.serial_short, serial_str, sizeof(serial_str));
- udev_util_replace_chars(serial_str, NULL);
+ util_replace_whitespace(dev_scsi.serial_short, serial_str, sizeof(serial_str));
+ util_replace_chars(serial_str, NULL);
printf("ID_SERIAL_SHORT=%s\n", serial_str);
}
if (dev_scsi.wwn[0] != '\0') {
@@ -593,8 +593,8 @@ static int scsi_id(struct udev *udev, char *maj_min_dev)
if (reformat_serial) {
char serial_str[MAX_SERIAL_LEN];
- udev_util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
- udev_util_replace_chars(serial_str, NULL);
+ util_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str));
+ util_replace_chars(serial_str, NULL);
printf("%s\n", serial_str);
goto out;
}