diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-11-12 23:05:39 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-11-12 23:06:34 +1300 |
commit | 95af45a16e513ea258f252d8a23bc22886930971 (patch) | |
tree | a0595f74637d50533da3c7698ee27b4f0ff8a421 | |
parent | Create header file (diff) | |
download | texad-95af45a16e513ea258f252d8a23bc22886930971.tar.gz texad-95af45a16e513ea258f252d8a23bc22886930971.zip |
Copy from local variable, don't reference it
How embarrassing!
-rw-r--r-- | texad.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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]; |