Fix Compiler Warning, minor tweaks

Fix Compiler Warning, minor tweaks to NCurses view and information logging
This commit is contained in:
lwvmobile 2022-03-13 20:32:32 -04:00 committed by GitHub
parent 6afb0d718f
commit 5ee669aa18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View File

@ -350,7 +350,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
printw ("| RAN: [%02d] ", rn);
printw ("TID: [%04d] ", tgn);
//printw ("| RID: [%d] \n", src);
printw ("RID: [%04d] \n| ALG: 0x[%02X] KEY 0x[%02X] ", src, state->nxdn_cipher_type, state->nxdn_key);
printw ("RID: [%04d] \n| ALG: [0x%02X] KEY [0x%02X] ", src, state->nxdn_cipher_type, state->nxdn_key);
if (state->carrier == 1)
{
printw("%s ", state->nxdn_call_type);

View File

@ -734,12 +734,10 @@ void NXDN_decode_VCALL(dsd_opts * opts, dsd_state * state, uint8_t * Message)
}
/* Print the "Call Type" */
//fprintf(stderr, "%s - ", NXDN_Call_Type_To_Str(CallType));
fprintf(stderr, "\n %s - ", NXDN_Call_Type_To_Str(CallType)); //line break and 1 space
sprintf (state->nxdn_call_type, NXDN_Call_Type_To_Str(CallType)); //fix warning below
//sprintf (state->nxdn_call_type, NXDN_Call_Type_To_Str(CallType)); //fix warning below
//warning: format not a string literal and no format arguments [-Wformat-security]
//state->nxdn_call_type = NXDN_Call_Type_To_Str(CallType);
sprintf (state->nxdn_call_type, "%s", NXDN_Call_Type_To_Str(CallType)); //fix warning below
/* Print the "Voice Call Option" */
NXDN_Voice_Call_Option_To_Str(VoiceCallOption, DuplexMode, TransmissionMode);

View File

@ -468,7 +468,7 @@ processHDU(dsd_opts* opts, dsd_state* state)
}
//if (state->errs == 0 && algidhex != 0x80)
if (opts->payload == 1 && state->errs == 0)
if (opts->payload == 1)
{
//fprintf (stderr, " HDU ALG ID: 0x%X KEY ID: 0x%X MI: %s \n", algidhex, kidhex, mi);
fprintf (stderr, " HDU ALG ID: 0x%X KEY ID: 0x%X MI: 0x%08llX%08llX%02llX\n", algidhex, kidhex, mihex1, mihex2, mihex3);

View File

@ -376,7 +376,7 @@ processLDU2 (dsd_opts * opts, dsd_state * state)
}
//if (state->errs == 0 && algidhex != 0x80)
if (opts->payload == 1 && state->errs == 0)
if (opts->payload == 1)
{
//fprintf (stderr, " LDU2 ALG ID: 0x%X KEY ID: 0x%X MI: %s \n", algidhex, kidhex, mi);
fprintf (stderr, " LDU2 ALG ID: 0x%X KEY ID: 0x%X MI: 0x%08llX%08llX%02llX\n", algidhex, kidhex, mihex1, mihex2, mihex3);