# HG changeset patch # User Matt Johnston # Date 1593175294 -28800 # Node ID 57226fc75cb5c11dd08d341fdaafcae61629351a # Parent f091f7536aa5a45f1918886dde7c6db3ffe6c9de Some notes on style diff -r f091f7536aa5 -r 57226fc75cb5 DEVELOPING.md --- a/DEVELOPING.md Thu Jun 25 23:18:16 2020 +0800 +++ b/DEVELOPING.md Fri Jun 26 20:41:34 2020 +0800 @@ -35,6 +35,30 @@ Enabling/disabling algorithms is done in [localoptions.h](localoptions.h), see [default_options.h](default_options.h). +## Style + +Source code is indented with tabs, width set to 4 (though width shouldn't +matter much). Braces are on the same line as functions/loops/if - try +to keep consistency with existing code. + +All `if` statements should have braces, no exceptions. + +Avoid using pointer arithmetic, instead the functions in +[buffer.h](buffer.h) should be used. + +Some Dropbear platforms have old compilers. +Variable declarations must be at the top of a scope and +comments must be `/* */` rather than `//`. + +Pointer variables should be initialised to NULL - it can reduce the +severity of bugs. + +## Third party code + +Libtomcrypt and libtommath are periodically synced from upstream, so +avoid making changes to that code which will need to be maintained. +Improvements can be sent upstream to the libtom project. + ## Non-root user Dropbear server will run fine as a non-root user, allowing logins only for