Hi Sergio,
On Sat, Jul 28, 2012 at 9:47 PM, Sergio Correia [off-list ref] wrote:
quoted
+uint16_t enc_prep_write_req(uint16_t handle, uint16_t offset,
+ const uint8_t *value, int vlen, uint8_t *pdu, int len)
+{
+ const uint16_t min_len = sizeof(pdu[0]) + sizeof(handle) +
+ sizeof(offset);
+
+ if (pdu == NULL)
+ return 0;
+
+ if (len < min_len)
+ return 0;
maybe it would be better to check the above conditions in a single if statement?
I think Eder is following the same style from the other similar
functions in the same file. I would suggest leaving these patches as
is and instead sending a separate patch changing this in all
functions, as a refactoring patch.
My two cents,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil