pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
196 stars 167 forks source link

Erroneous assignment? #364

Open niclash opened 4 years ago

niclash commented 4 years ago

https://github.com/pycom/pycom-micropython-sigfox/blob/69dd8b5d6be5561742aed088ab8f5677668ad3a0/esp32/mods/modlora.c#L1619

I am not a avid C/C++ programmer, but I think the assignment on this line is incorrect. The rx_data structure is allocated on the stack, it seems odd that whatever the default is (0 or random, not sure) would be adequate to write into the *port location.

niclash commented 4 years ago

This come on my radar because my current C/C++ toolchain for PyCom is now treating this as a compile error.

niclash commented 4 years ago

Looking at what is tried to be achieved here, I think the assignment should be changed to;

        if (port != NULL) {
            *port = lora_partial_rx_packet.port;
        }