* HACKING: Add to section "Programming Tips" g_free tip.
Этот коммит содержится в:
родитель
c9f834b501
Коммит
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);
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user