diff --git a/HACKING b/HACKING index 8a092af42..1aff40f53 100644 --- a/HACKING +++ b/HACKING @@ -311,6 +311,8 @@ Programming Tips (This list should be sorted alphabetically.) +catstrs: (see NULL). + const: For every function taking a string argument, decide whether you (as a user of the function) would expect that the string is modi- fied by the function. If not, declare the string argument as @@ -325,12 +327,16 @@ const_cast: We use many libraries that do not know about "const char *" and function does with the string, we should use g_strdup to pass dynamically allocated strings. +execl, execle, execlp: (see NULL). + g_free: g_free handles NULL argument too, no need for the comparison. Bad way: if (old_dir) g_free (old_dir); Right way: g_free (old_dir); +g_strconcat: (see NULL). + g_strdup: When you use g_strdup to create a local copy of a string, use the following pattern to keep the reference.