run trunk fmt -a (#9400)

* run trunk fmt -a

* fix bracket bug

This was introduced by @tedwardd and @thebentern in 021106dfe5.

See this diff:
         else
+            checkConfigPort = false;
             printf("Using config file %d\n", TCPPort);
This commit is contained in:
Jorropo
2026-01-22 22:46:37 +01:00
committed by GitHub
parent d8d02cd6ec
commit 4744010295
3 changed files with 9 additions and 11 deletions

View File

@@ -61,11 +61,12 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
{
switch (key) {
case 'p':
if (sscanf(arg, "%d", &TCPPort) < 1)
if (sscanf(arg, "%d", &TCPPort) < 1) {
return ARGP_ERR_UNKNOWN;
else
} else {
checkConfigPort = false;
printf("Using config file %d\n", TCPPort);
}
break;
case 'c':
configPath = arg;
@@ -887,10 +888,8 @@ bool loadConfig(const char *configPath)
}
if (checkConfigPort) {
portduino_config.api_port = (yamlConfig["General"]["APIPort"]).as<int>(-1);
if (portduino_config.api_port != -1 &&
portduino_config.api_port > 1023 &&
portduino_config.api_port < 65536) {
TCPPort = (portduino_config.api_port);
if (portduino_config.api_port != -1 && portduino_config.api_port > 1023 && portduino_config.api_port < 65536) {
TCPPort = (portduino_config.api_port);
}
}
portduino_config.mac_address = (yamlConfig["General"]["MACAddress"]).as<std::string>("");