Skip to content

Commit

Permalink
Wrap the usage of the DNS cache variable in if the config to enable i…
Browse files Browse the repository at this point in the history
…t is set.
  • Loading branch information
Skptak committed Apr 4, 2024
1 parent 1f59754 commit 31a7943
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/FreeRTOS_DNS.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@
pxAddrInfo = ( struct freertos_addrinfo * ) pvBuffer;

( void ) memset( pxAddrInfo, 0, sizeof( *pxAddrInfo ) );
pxAddrInfo->ai_canonname = pxAddrInfo->xPrivateStorage.ucName;
( void ) strncpy( pxAddrInfo->xPrivateStorage.ucName, pcName, sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1U );
pxAddrInfo->xPrivateStorage.ucName[ sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1U ] = '\0';
#if ( ipconfigUSE_DNS_CACHE != 0 )
pxAddrInfo->ai_canonname = pxAddrInfo->xPrivateStorage.ucName;
( void ) strncpy( pxAddrInfo->xPrivateStorage.ucName, pcName, sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1U );
pxAddrInfo->xPrivateStorage.ucName[ sizeof( pxAddrInfo->xPrivateStorage.ucName ) - 1U ] = '\0';
#endif /* (ipconfigUSE_DNS_CACHE != 0 ) */

pxAddrInfo->ai_addr = ( ( struct freertos_sockaddr * ) &( pxAddrInfo->xPrivateStorage.sockaddr ) );

Expand Down

0 comments on commit 31a7943

Please sign in to comment.