diff options
author | Lucas De Marchi <lucas.de.marchi@gmail.com> | 2013-04-23 20:33:13 -0300 |
---|---|---|
committer | Lucas De Marchi <lucas.de.marchi@gmail.com> | 2013-04-23 21:26:08 -0300 |
commit | 818af4f6fa925a2affdc6d65e9d18d6922b11baf (patch) | |
tree | 0521cefc163c1bac1c1ba305da15578b23517eae /CODING-STYLE | |
parent | eb978f10bd3ba10fb8e14026209ba4a0cb947ff8 (diff) | |
download | kmod-818af4f6fa925a2affdc6d65e9d18d6922b11baf.tar.gz kmod-818af4f6fa925a2affdc6d65e9d18d6922b11baf.tar.bz2 kmod-818af4f6fa925a2affdc6d65e9d18d6922b11baf.zip |
libkmod-module: Don't pass NULL pointer to memcpy
When passing n=0, don't pass a NULL pointer, but instead pass anything
else (like the pointer to the start of the string).
Diffstat (limited to 'CODING-STYLE')
-rw-r--r-- | CODING-STYLE | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/CODING-STYLE b/CODING-STYLE index e60df9e..865252e 100644 --- a/CODING-STYLE +++ b/CODING-STYLE @@ -15,10 +15,12 @@ them is actually an error. In certain circumstances one can ignore the 80 character per line limit. This is generally only allowed if the alternative would make the code even less readable. -Besides the kernel coding style above, kmod coding style is havily based on +Besides the kernel coding style above, kmod coding style is heavily based on oFono's and BlueZ's. Below some basic rules: -1) Wrap line at 80 char limit. There are a few exceptions: +1) Wrap line at 80 char limit. + +There are a few exceptions: - Headers may or may not wrap - If it's a string that is hitting the limit, it's preferred not to break in order to be able to grep for that string. E.g: @@ -29,6 +31,9 @@ oFono's and BlueZ's. Below some basic rules: - If there's only one argument to the function, don't put it alone in a new line. +Align the wrapped line either with tabs (BlueZ, oFono, etc) or tab + spaces +(kernel), at your discretion. Kernel's is preferred. + 2) It's better to return/exit early in a function than having a really long "if (...) { }". Example: |