Fix rotctl \dump_caps output

rot_sprintf_status() was printing items multiple times.
Cause of problem noticed by cppcheck.
pull/1783/head
George Baltz N3GB 2025-06-24 21:48:09 -04:00
rodzic aa3e6cb6e9
commit 0b75b96ef1
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -358,6 +358,8 @@ typedef enum {
ROT_STATUS_OVERLAP_LEFT = (1 << 14), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees. */ ROT_STATUS_OVERLAP_LEFT = (1 << 14), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees. */
ROT_STATUS_OVERLAP_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees. */ ROT_STATUS_OVERLAP_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees. */
} rot_status_t; } rot_status_t;
// Update this if any additions to status definitions
#define HAMLIB_MAX_ROTOR_STATUS 16
//! @cond Doxygen_Suppress //! @cond Doxygen_Suppress
/* So far only used in tests/sprintflst.c. */ /* So far only used in tests/sprintflst.c. */

Wyświetl plik

@ -819,7 +819,7 @@ int rot_sprintf_status(char *str, int nlen, rot_status_t status)
return 0; return 0;
} }
for (i = 0; i < HAMLIB_MAX_ROTORS; i++) for (i = 0; i <= HAMLIB_MAX_ROTOR_STATUS; i++)
{ {
const char *sv = rot_strstatus(status & ROT_STATUS_N(i)); const char *sv = rot_strstatus(status & ROT_STATUS_N(i));