Skip to content

Commit

Permalink
don't truncate reason when initializing
Browse files Browse the repository at this point in the history
this makes -v output much more readable too!

Thanks -Werror=stringop-truncation
  • Loading branch information
evgeni committed May 28, 2024
1 parent 6df6723 commit a8c2339
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hdapsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ int analyze (int x, int y, double unow, double base_threshold,
threshold *= PARKED_THRESH_FACTOR;

/* Threshold test (uses Pythagoras's theorem) */
strncpy(reason, " ", 3);
strncpy(reason, " ", 4);

check_thresh(veloc_sqr, threshold*VELOC_ADJUST,
&above, &near, reason+0, 'V');
Expand Down

0 comments on commit a8c2339

Please sign in to comment.