]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/script.c
Add padding between odhcp6c_entry structures to ensure 32-bit alignment
[odhcp6c.git] / src / script.c
index 1533510dbab56c8d8394298ecf48c844b9255380..72add2135e8c6aae37184a9699fd43ca70036d50 100644 (file)
@@ -220,8 +220,9 @@ static void search_to_env(const char *name, const uint8_t *start, size_t len)
        *c++ = '=';
 
        for (struct odhcp6c_entry *e = (struct odhcp6c_entry*)start;
-                               (uint8_t*)e < &start[len] && &e->auxtarget[e->auxlen] <= &start[len];
-                               e = (struct odhcp6c_entry*)(&e->auxtarget[e->auxlen])) {
+                               (uint8_t*)e < &start[len] &&
+                               (uint8_t*)odhcp6c_next_entry(e) <= &start[len];
+                               e = odhcp6c_next_entry(e)) {
                c = mempcpy(c, e->auxtarget, e->auxlen);
                *c++ = ' ';
        }