Commit 9b8943b5 authored by Alessandro Rubini's avatar Alessandro Rubini

userspace/hal: buglet fix: write ports array from index 0

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e6b79e69
......@@ -206,7 +206,7 @@ static int hal_port_init(const char *name, int index)
* intializes them one after another. */
int hal_port_init_all()
{
int index = 0, i;
int index, i;
char port_name[128];
struct hal_shmem_header *hal_hdr;
struct wrs_shm_head *head;
......@@ -255,8 +255,8 @@ int hal_port_init_all()
hal_hdr->ports = ports;
for (;;) {
if (!hal_config_iterate("ports", index++,
for (index = 0; index < HAL_MAX_PORTS; index++) {
if (!hal_config_iterate("ports", index,
port_name, sizeof(port_name)))
break;
hal_port_init(port_name, index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment