Arduino_SNMP
Arduino_SNMP copied to clipboard
why use char** if buffers does not reallocated?
hello, i am very green in all areas, MCU, C, etc. So i sit together with Copilot and learn how this code works. And one of problem what exists for me, is why you use char** for RW strings? Copilot looks at library code and said, what strings are modified without reallocation, so char* is enough. This will make more simple data structures, which describe OID sets. And thank you for your library :)
addReadWriteStringHandler(const char *oid, char** value, size_t max_len, …)
That means it expects the address of a char*, not just a char*. Even though we’ve confirmed from the implementation that it never actually reassigns the pointer, you still have to comply with the signature.