Skip to content

Commit

Permalink
Logic simplification. Replace memmove by memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
JuantAldea authored and egzumer committed Dec 13, 2023
1 parent 8c7f736 commit 34d688b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/dtmf.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ bool DTMF_GetContact(const int Index, char *pContact)
EEPROM_ReadBuffer(0x1C00 + (Index * 16), pContact, 16);
i = (int)pContact[0] - ' ';
}
return (i < 0 || i >= 95) ? false : true;
return (i >= 0 && i < 95);
}

bool DTMF_FindContact(const char *pContact, char *pResult)
Expand All @@ -130,7 +130,7 @@ bool DTMF_FindContact(const char *pContact, char *pResult)

if (j == 3)
{
memmove(pResult, Contact, 8);
memcpy(pResult, Contact, 8);
pResult[8] = 0;
return true;
}
Expand Down Expand Up @@ -361,8 +361,8 @@ void DTMF_HandleRequest(void)

memset(gDTMF_Callee, 0, sizeof(gDTMF_Callee));
memset(gDTMF_Caller, 0, sizeof(gDTMF_Caller));
memmove(gDTMF_Callee, gDTMF_RX + Offset + 0, 3);
memmove(gDTMF_Caller, gDTMF_RX + Offset + 4, 3);
memcpy(gDTMF_Callee, gDTMF_RX + Offset + 0, 3);
memcpy(gDTMF_Caller, gDTMF_RX + Offset + 4, 3);

DTMF_clear_RX();

Expand Down

0 comments on commit 34d688b

Please sign in to comment.