diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-26 02:31:54 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-26 02:31:54 +0100 |
commit | 1822e9b033fcd91a7dfd3b0bfd12cfbbd93fc470 (patch) | |
tree | d9c37e4dc229d815686de1ae68f07bae63b605c3 /extras | |
parent | 21cfb0436c736c262baa37d96625041e3a96db07 (diff) |
do not init string arrays, just clear first byte
Diffstat (limited to 'extras')
-rw-r--r-- | extras/edd_id/edd_id.c | 5 | ||||
-rw-r--r-- | extras/scsi_id/scsi_id.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/extras/edd_id/edd_id.c b/extras/edd_id/edd_id.c index d7aec1488c..4154387cb6 100644 --- a/extras/edd_id/edd_id.c +++ b/extras/edd_id/edd_id.c @@ -45,9 +45,9 @@ int main(int argc, char *argv[]) int sysfs_fd; DIR *dir = NULL; int rc = 1; - char match[NAME_MAX] = ""; + char match[NAME_MAX]; - udev = udev_new(); + udev = udev_new(); if (udev == NULL) goto exit; @@ -124,6 +124,7 @@ int main(int argc, char *argv[]) } /* lookup signature in sysfs to determine the name */ + match[0] = '\0'; for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { char file[UTIL_PATH_SIZE]; char sysfs_id_buf[256]; diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c index 86c76cfcc4..45e48601f7 100644 --- a/extras/scsi_id/scsi_id.c +++ b/extras/scsi_id/scsi_id.c @@ -579,8 +579,9 @@ static int scsi_id(struct udev *udev, char *maj_min_dev) struct scsi_id_device dev_scsi; int good_dev; int page_code; - char serial_short[MAX_SERIAL_LEN] = ""; + char serial_short[MAX_SERIAL_LEN]; + serial_short[0] = '\0'; set_inq_values(udev, &dev_scsi, maj_min_dev); /* get per device (vendor + model) options from the config file */ |