Branch: Tag:

2014-12-06

2014-12-06 18:05:48 by Marcus Comstedt <marcus@mc.pp.se>

Stdio.Buffer: Fix alignment problem in io_append_{short,int}_uc

779:       static void io_append_short_uc( Buffer *io, unsigned short shrt )    { -  *((short *)(io->buffer+io->len)) = htons(shrt); -  io->len+=2; +  io->buffer[io->len++] = shrt>>8; +  io->buffer[io->len++] = shrt;    }       static void io_append_int_uc( Buffer *io, unsigned INT32 i )    { -  *((INT32 *)(io->buffer+io->len)) = htonl(i); -  io->len+=4; +  io->buffer[io->len++] = i>>24; +  io->buffer[io->len++] = i>>16; +  io->buffer[io->len++] = i>>8; +  io->buffer[io->len++] = i;    }