mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
* HACKING: Add to section "Programming Tips" g_free tip.
This commit is contained in:
parent
c9f834b501
commit
e5f21875a3
@ -1,3 +1,7 @@
|
||||
2004-09-04 Pavel S. Shirshov <pavelsh@mail.ru>
|
||||
|
||||
* HACKING: Add to section "Programming Tips" g_free tip.
|
||||
|
||||
2004-09-02 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* HACKING: Added a section "Programming Tips" which lists mistakes
|
||||
|
6
HACKING
6
HACKING
@ -296,3 +296,9 @@ size_t: This data type is suitable for expressing sizes of memory or the
|
||||
|
||||
strncpy: Don't use this function in newly created code. It is slow, insecure
|
||||
and hard to use. A much better alternative is g_strlcpy (see there).
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user