mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
goptions: use G_N_ELEMENTS instead of nitems
This commit is contained in:
committed by
Matthias Clasen
parent
9e0ea40537
commit
c9b399365f
@@ -1680,11 +1680,7 @@ platform_get_argv0 (void)
|
|||||||
|
|
||||||
cmdline = (char **) realloc (cmdline, len);
|
cmdline = (char **) realloc (cmdline, len);
|
||||||
|
|
||||||
#ifndef nitems
|
if (sysctl (mib, G_N_ELEMENTS (mib), cmdline, &len, NULL, 0) == -1)
|
||||||
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (sysctl (mib, nitems (mib), cmdline, &len, NULL, 0) == -1)
|
|
||||||
{
|
{
|
||||||
g_free (cmdline);
|
g_free (cmdline);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user