From 341a5201c6748bf17f0caa003fce2a7b87530bc2 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Fri, 29 Aug 2025 23:04:00 +0200 Subject: [PATCH] Replace literal constant with defined symbol --- src/misc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/misc.c b/src/misc.c index 2156d0b7b..d363f0f1b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2131,14 +2131,14 @@ int HAMLIB_API parse_hoststr(char *hoststr, int hoststr_len, char host[256], // Exclude any names that aren't a host:port format // Handle device names 1st - if (strstr(hoststr, "/dev")) { return -1; } + if (strstr(hoststr, "/dev")) { return -RIG_EINVAL; } - if (strstr(hoststr, "/")) { return -1; } // probably a path so not a hoststr + if (strstr(hoststr, "/")) { return -RIG_EINVAL; } // probably a path so not a hoststr - if (strncasecmp(hoststr, "com", 3) == 0) { return -1; } + if (strncasecmp(hoststr, "com", 3) == 0) { return -RIG_EINVAL; } // escaped COM port like \\.\COM3 or \.\COM3 - if (strstr(hoststr, "\\.\\")) { return -1; } + if (strstr(hoststr, "\\.\\")) { return -RIG_EINVAL; } // Now let's try and parse a host:port thing // bracketed IPV6 with optional port @@ -2235,7 +2235,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, int hoststr_len, char host[256], rig_debug(RIG_DEBUG_BUG, "%s: Unhandled host=%s\n", __func__, hoststr); - return -1; + return -RIG_EINVAL; }