chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use more efficient string copying
[elogind.git]
/
extras
/
edd_id
/
edd_id.c
diff --git
a/extras/edd_id/edd_id.c
b/extras/edd_id/edd_id.c
index d7aec1488ccd5fe86dd714d20c1723c49d2ae8b8..9e9667fc62ab87a0abd6517e4a0eeb9e64994fa9 100644
(file)
--- 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;
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;
if (udev == NULL)
goto exit;
@@
-124,6
+124,7
@@
int main(int argc, char *argv[])
}
/* lookup signature in sysfs to determine the name */
}
/* 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];
for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
char file[UTIL_PATH_SIZE];
char sysfs_id_buf[256];
@@
-156,7
+157,7
@@
int main(int argc, char *argv[])
if (disk_id == sysfs_id) {
if (match[0] == '\0') {
/* store id */
if (disk_id == sysfs_id) {
if (match[0] == '\0') {
/* store id */
- util_str
lcpy(match, dent->d_name, sizeof(match)
);
+ util_str
scpy(match, sizeof(match), dent->d_name
);
} else {
/* error, same signature for another device */
info(udev, "'%s' does not have a unique signature\n", node);
} else {
/* error, same signature for another device */
info(udev, "'%s' does not have a unique signature\n", node);