X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udevinfo.c;h=d0b1c447f4d65f2692b026996333dbf58f8f0328;hb=584fbf1ba459b4425c6757ca08918d760def62ef;hp=f36f240f0a710971723a453b927d4ae9f4ae568d;hpb=019d6669076f52994cca199fbbae6eefbb96aeb8;p=elogind.git diff --git a/udevinfo.c b/udevinfo.c index f36f240f0..d0b1c447f 100644 --- a/udevinfo.c +++ b/udevinfo.c @@ -93,7 +93,7 @@ static void print_all_attributes(const char *devpath, const char *key) continue; } - replace_untrusted_chars(value); + replace_chars(value, ALLOWED_CHARS_INPUT); printf(" %s{%s}==\"%s\"\n", key, dent->d_name, value); } } @@ -265,7 +265,6 @@ int main(int argc, char *argv[], char *envp[]) goto exit; } - /* get command line options */ while (1) { option = getopt_long(argc, argv, "aen:p:q:rVh", options, NULL); if (option == -1) @@ -279,7 +278,7 @@ int main(int argc, char *argv[], char *envp[]) strlcpy(name, &optarg[strlen(udev_root)+1], sizeof(name)); else strlcpy(name, optarg, sizeof(name)); - dbg("name: %s\n", name); + dbg("name: %s", name); break; case 'p': /* remove /sys if given */ @@ -287,10 +286,9 @@ int main(int argc, char *argv[], char *envp[]) strlcpy(path, &optarg[strlen(sysfs_path)], sizeof(path)); else strlcpy(path, optarg, sizeof(path)); - dbg("path: %s\n", path); + dbg("path: %s", path); break; case 'q': - dbg("udev query: %s\n", optarg); action = ACTION_QUERY; if (strcmp(optarg, "name") == 0) { query = QUERY_NAME; @@ -413,7 +411,7 @@ int main(int argc, char *argv[], char *envp[]) case ACTION_ATTRIBUTE_WALK: if (path[0] != '\0') { if (print_device_chain(path) != 0) { - fprintf(stderr, "device not found\n"); + fprintf(stderr, "no valid sysfs device found\n"); rc = 4; goto exit; } @@ -424,7 +422,7 @@ int main(int argc, char *argv[], char *envp[]) goto exit; } if (print_device_chain(udev->dev->devpath) != 0) { - fprintf(stderr, "device not found\n"); + fprintf(stderr, "no valid sysfs device found\n"); rc = 4; goto exit; }