Closed monocle-ai closed 3 years ago
Hi @monocle-ai ,
as we have in our disclaimer in our samples, the returns are omitted intentionally.
// CAVEAT: This sample is to demonstrate azure IoT client concepts only and is not a guide design principles or style
// Checking of return codes and error values are omitted for brevity. Please practice sound engineering practices
// when writing production code.
So this won't be a change we can take.
Thanks, Azure SDK Team.
@monocle-ai, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey
In this codebase, you often check the return value of the implicated function when calling it, but in this instance, it appears that you didn’t. Using a consistent return value checking and/or error handling approach can improve code robustness and readability.
1 instance of this defect were found in the following locations:
Instance 1 File :
samples/solutions/remote_monitoring_client/remote_monitoring.c
Enclosing Function :send_message
Function :strftime
https://github.com/Azure/azure-iot-sdk-c/blob/0ca4bbb7c416dd347398fe5897cc38193b6f03fe/samples/solutions/remote_monitoring_client/remote_monitoring.c#L344 Code extract:How can I fix it? Correct reference usage found in
iothub_client/samples/pnp/pnp_temperature_controller/pnp_thermostat_component.c
at line85
. https://github.com/Azure/azure-iot-sdk-c/blob/0ca4bbb7c416dd347398fe5897cc38193b6f03fe/iothub_client/samples/pnp/pnp_temperature_controller/pnp_thermostat_component.c#L85 Code extract: