[glib: 5/8] goption: Use new g_newa0() function
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 5/8] goption: Use new g_newa0() function
- Date: Fri, 26 Nov 2021 12:38:47 +0000 (UTC)
commit b321bf70d71744ffb803c108ab61624f1dc46307
Author: Nishal Kulkarni <nishalkulkarni gmail com>
Date: Thu Nov 25 16:15:16 2021 +0530
goption: Use new g_newa0() function
Replace old `g_newa()` and `memset()` with `g_newa0()`
glib/goption.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/glib/goption.c b/glib/goption.c
index 8cb72376c..50812ea35 100644
--- a/glib/goption.c
+++ b/glib/goption.c
@@ -2113,8 +2113,7 @@ g_option_context_parse (GOptionContext *context,
gboolean has_h_entry = context_has_h_entry (context);
arg = (*argv)[i] + 1;
arg_length = strlen (arg);
- nulled_out = g_newa (gboolean, arg_length);
- memset (nulled_out, 0, arg_length * sizeof (gboolean));
+ nulled_out = g_newa0 (gboolean, arg_length);
for (j = 0; j < arg_length; j++)
{
if (context->help_enabled && (arg[j] == '?' ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]