if (strcasecmp(variable, "udev_root") == 0) {
strlcpy(udev_root, value, sizeof(udev_root));
- remove_trailing_char(udev_root, '/');
+ remove_trailing_chars(udev_root, '/');
continue;
}
if (strcasecmp(variable, "udev_db") == 0) {
strlcpy(udev_db_path, value, sizeof(udev_db_path));
- remove_trailing_char(udev_db_path, '/');
+ remove_trailing_chars(udev_db_path, '/');
continue;
}
if (strcasecmp(variable, "udev_rules") == 0) {
strlcpy(udev_rules_filename, value, sizeof(udev_rules_filename));
- remove_trailing_char(udev_rules_filename, '/');
+ remove_trailing_chars(udev_rules_filename, '/');
continue;
}
env = getenv("UDEV_CONFIG_FILE");
if (env) {
strlcpy(udev_config_filename, env, sizeof(udev_config_filename));
- remove_trailing_char(udev_config_filename, '/');
+ remove_trailing_chars(udev_config_filename, '/');
}
parse_config_file();
if (devpath) {
strlcpy(udev->devpath, devpath, sizeof(udev->devpath));
- remove_trailing_char(udev->devpath, '/');
+ remove_trailing_chars(udev->devpath, '/');
if (strncmp(udev->devpath, "/block/", 7) == 0)
udev->type = DEV_BLOCK;
attr_found:
strlcpy(value, tmpattr->value, len);
- remove_trailing_char(value, '\n');
+ remove_trailing_chars(value, '\n');
dbg("found attribute '%s'", tmpattr->path);
return 0;
int count;
dbg("PROGRAM matches");
- remove_trailing_char(result, '\n');
+ remove_trailing_chars(result, '\n');
count = replace_untrusted_chars(result);
if (count)
info("%i untrusted character(s) replaced" , count);
/* udev_utils_string.c */
extern int strcmp_pattern(const char *p, const char *s);
extern int string_is_true(const char *str);
-extern void remove_trailing_char(char *path, char c);
+extern void remove_trailing_chars(char *path, char c);
extern int utf8_encoded_valid_unichar(const char *str);
extern int replace_untrusted_chars(char *str);
return 0;
}
-void remove_trailing_char(char *path, char c)
+void remove_trailing_chars(char *path, char c)
{
size_t len;