be more tolerant for MQTT topic but deny wildcard characters

This commit is contained in:
john30
2017-03-19 12:50:16 +01:00
parent 73de8b3d86
commit f7f79bb1e7
+1 -1
View File
@@ -105,7 +105,7 @@ static error_t mqtt_parse_opt(int key, char *arg, struct argp_state *state) {
break;
case 5: // --mqtttopic=ebusd
if (arg == NULL || arg[0] == 0 || arg[0] == '/' || arg[strlen(arg)-1] == '/') {
if (arg == NULL || arg[0] == 0 || strchr(arg, '#') || strchr(arg, '+') || arg[strlen(arg)-1] == '/') {
argp_error(state, "invalid mqtttopic");
return EINVAL;
}