diff options
author | Christian Boos <cboos@edgewall.org> | 2013-10-18 13:23:43 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-10-18 13:23:43 +0300 |
commit | e498e464dc75423b8ac9979f828851b0c785c296 (patch) | |
tree | a46e9d0c39caac373f61005ccf2646df4d6538db | |
parent | d1d737d0fafeb0b50452b6e94c808852712a5d3a (diff) | |
download | gunmake-e498e464dc75423b8ac9979f828851b0c785c296.tar.gz |
Fix initialization of stringlist variables for jobserver_fds and sync_mutex.
(tiny change)
main.c (prepare_mutex_handle_string, main): Initialize
stringlist variables with at least 2 members, as one member is not
currently supported.
-rw-r--r-- | main.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -811,10 +811,11 @@ prepare_mutex_handle_string (sync_handle_t handle) /* Prepare the mutex handle string for our children. */ sprintf (hdl_string, "0x%x", handle); sync_mutex = xmalloc (sizeof (struct stringlist)); - sync_mutex->list = xmalloc (sizeof (char *)); + sync_mutex->list = xmalloc (2 * sizeof (char *)); sync_mutex->list[0] = xstrdup (hdl_string); + sync_mutex->list[1] = NULL; sync_mutex->idx = 1; - sync_mutex->max = 1; + sync_mutex->max = 2; define_makeflags (1, 0); } } @@ -2051,10 +2052,11 @@ main (int argc, char **argv, char **envp) #endif jobserver_fds = xmalloc (sizeof (struct stringlist)); - jobserver_fds->list = xmalloc (sizeof (char *)); + jobserver_fds->list = xmalloc (2 * sizeof (char *)); jobserver_fds->list[0] = cp; + jobserver_fds->list[1] = NULL; jobserver_fds->idx = 1; - jobserver_fds->max = 1; + jobserver_fds->max = 2; } #endif |