Fix -Werror=maybe-uninitialized in uds.c...

...when building with -Os/-Og
This commit is contained in:
TuxSH 2017-04-02 16:24:58 +02:00
parent cdababc38d
commit eb681db5af

View File

@ -501,13 +501,10 @@ Result udsScanBeacons(void *buf, size_t maxsize, udsNetworkScanInfo **networks,
{
networks_ptr = malloc(sizeof(udsNetworkScanInfo) * hdr->total_entries);
if(networks_ptr == NULL)return -1;
if(total_networks)*total_networks = hdr->total_entries;
memset(networks_ptr, 0, sizeof(udsNetworkScanInfo) * hdr->total_entries);
*networks = networks_ptr;
}
if(total_networks)*total_networks = hdr->total_entries;
if(networks)
{
for(entpos=0; entpos<hdr->total_entries; entpos++)
{
if(curpos >= hdr->size)