summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-12 23:05:39 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-12 23:06:34 +1300
commit95af45a16e513ea258f252d8a23bc22886930971 (patch)
treea0595f74637d50533da3c7698ee27b4f0ff8a421
parentCreate header file (diff)
downloadtexad-95af45a16e513ea258f252d8a23bc22886930971.tar.gz
texad-95af45a16e513ea258f252d8a23bc22886930971.zip
Copy from local variable, don't reference it
How embarrassing!
-rw-r--r--texad.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/texad.c b/texad.c
index 6b18318..fec3cc6 100644
--- a/texad.c
+++ b/texad.c
@@ -52,9 +52,10 @@ struct world *genesis(void)
{d[3], NULL, NULL}
};
- r[0]->doors = ds[0];
- r[1]->doors = ds[1];
- r[2]->doors = ds[2];
+ for (i = 0; i < sizeof r / sizeof r[0]; i++) {
+ r[i]->doors = malloc(sizeof ds[i]);
+ memcpy(r[i]->doors, ds[i], sizeof ds[i]);
+ }
p->room = r[0];