Skip to content

Commit

Permalink
Merge pull request #439 from dl1jbe/fix_number_of_nodes
Browse files Browse the repository at this point in the history
Fix handling of range of allowed TLF nodes
  • Loading branch information
airween authored Sep 14, 2024
2 parents 6304d7d + e5e7351 commit ac1592f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit ac1592f

Please sign in to comment.