#include #include #include int dbus_objpath_alnumify(char *path) { for (size_t i = 0; path[i]; i++) { if (!isalnum(path[i]) && path[i] != '/') path[i] = '_'; else if (i > 0 && path[i] == '/' && path[i - 1] == '/') return -EINVAL; } return 0; }