Fix rotctl \dump_caps output

rot_sprintf_status() was printing items multiple times.
Cause of problem noticed by cppcheck.

(cherry picked from commit 0b75b96ef1)
Hamlib-4.6.3
George Baltz N3GB 2025-06-24 21:48:09 -04:00 zatwierdzone przez Nate Bargmann
rodzic f518c478f2
commit 53c30fcf8c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: FB2C5130D55A8819
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_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees. */
} rot_status_t;
// Update this if any additions to status definitions
#define HAMLIB_MAX_ROTOR_STATUS 16
//! @cond Doxygen_Suppress
/* So far only used in tests/sprintflst.c. */

Wyświetl plik

@ -816,7 +816,7 @@ int rot_sprintf_status(char *str, int nlen, rot_status_t status)
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));