modbus: initialize return variable.
Currently, when disabling CONFIG_MODBUS_FP_EXTENSIONS,return variable 'err' is not initialized (at least not for debug builds) but later on checked. Signed-off-by: Stephan Gatzka <stephan.gatzka@gmail.com>
This commit is contained in:
parent
3936470973
commit
bda1970b33
1 changed files with 2 additions and 2 deletions
|
|
@ -309,7 +309,7 @@ static bool mbs_fc03_hreg_read(struct modbus_context *ctx)
|
|||
const uint16_t regs_limit = 125;
|
||||
const uint8_t request_len = 4;
|
||||
uint8_t *presp;
|
||||
uint16_t err;
|
||||
uint16_t err = 0;
|
||||
uint16_t reg_addr;
|
||||
uint16_t reg_qty;
|
||||
uint16_t num_bytes;
|
||||
|
|
@ -421,7 +421,7 @@ static bool mbs_fc04_inreg_read(struct modbus_context *ctx)
|
|||
const uint16_t regs_limit = 125;
|
||||
const uint8_t request_len = 4;
|
||||
uint8_t *presp;
|
||||
int err;
|
||||
int err = 0;
|
||||
uint16_t reg_addr;
|
||||
uint16_t reg_qty;
|
||||
uint16_t num_bytes;
|
||||
|
|
|
|||
Loading…
Reference in a new issue