projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
utils: Refactor check_id out of protocol for global access
[tinc]
/
src
/
tincctl.c
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
c0c8a25
..
158dfed
100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-1635,9
+1635,12
@@
static int cmd_config(int argc, char *argv[]) {
}
if(action < -1) {
}
if(action < -1) {
- if(!found)
+ if(found) {
+ return 0;
+ } else {
fprintf(stderr, "No matching configuration variables found.\n");
fprintf(stderr, "No matching configuration variables found.\n");
- return 1;
+ return 1;
+ }
}
// Make sure we wrote everything...
}
// Make sure we wrote everything...
@@
-1672,18
+1675,6
@@
static int cmd_config(int argc, char *argv[]) {
return 0;
}
return 0;
}
-bool check_id(const char *name) {
- if(!name || !*name)
- return false;
-
- for(int i = 0; i < strlen(name); i++) {
- if(!isalnum(name[i]) && name[i] != '_')
- return false;
- }
-
- return true;
-}
-
static bool try_bind(int port) {
struct addrinfo *ai = NULL;
struct addrinfo hint = {
static bool try_bind(int port) {
struct addrinfo *ai = NULL;
struct addrinfo hint = {