Read-only values should be marked with const to help the compiler
optimize code. But this would requrire a bigger rewirte of all the code,
hence the original code did not use const at all.
This should be done in the future to ensure good code quality
and performance.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
This fixes segfaults and pointers with invalid strings for:
- dmuci_add_section
- dmuci_set_value_by_section
- dmuci_set_value
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
- remove unused variables
- fix coding style of most function (Indentation, Tabulation, ..)
- check the source code using cppcheck tool
- change sprintf by snprintf