Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of range of allowed TLF nodes #439

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/background_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void *background_process(void *ptr) {
break;
case FREQMSG:
if ((lan_message[0] >= 'A')
&& (lan_message[0] <= 'A' + MAXNODES)) {
&& (lan_message[0] < 'A' + MAXNODES)) {
node_frequencies[lan_message[0] - 'A'] =
atof(lan_message + 2) * 1000.0;
break;
Expand All @@ -229,7 +229,7 @@ void *background_process(void *ptr) {

case TIMESYNC:
if ((lan_message[0] >= 'A')
&& (lan_message[0] <= 'A' + MAXNODES)) {
&& (lan_message[0] < 'A' + MAXNODES)) {
time_t lantime = atoi(lan_message + 2);

time_t delta = lantime - (get_time() - timecorr);
Expand Down
2 changes: 1 addition & 1 deletion src/parse_logcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static int cfg_thisnode(const cfg_arg_t arg) {
char *str = g_ascii_strup(parameter, -1);
g_strstrip(str);

if (strlen(str) != 1 || str[0] < 'A' || str[0] > 'A' + MAXNODES) {
if (strlen(str) != 1 || str[0] < 'A' || str[0] >= 'A' + MAXNODES) {
g_free(str);
error_details = g_strdup_printf("name is A..%c", 'A' + MAXNODES - 1);
return PARSE_WRONG_PARAMETER;
Expand Down