X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-stmload%2Fao-stmload.c;h=a471dcc47358b6d54a1dcefaae6769d73b750946;hb=1c9a3a5080ca0e21f45c2b7ea889793645796751;hp=e689539bb41c5b3e372c3698d2ae601444fdf30c;hpb=20877ae9de8bb5d3a29e2a96024e53afbd396f55;p=fw%2Faltos diff --git a/ao-tools/ao-stmload/ao-stmload.c b/ao-tools/ao-stmload/ao-stmload.c index e689539b..a471dcc4 100644 --- a/ao-tools/ao-stmload/ao-stmload.c +++ b/ao-tools/ao-stmload/ao-stmload.c @@ -112,10 +112,17 @@ struct load { uint8_t buf[0]; }; +uint32_t round4(uint32_t a) { + return (a + 3) & ~3; +} + struct load * new_load (uint32_t addr, uint32_t len) { - struct load *new = calloc (1, sizeof (struct load) + len); + struct load *new; + + len = round4(len); + new = calloc (1, sizeof (struct load) + len); if (!new) abort();