[Debburn-devel] [PATCH] fixes for aliasing bugs
Peter Samuelson
peter at p12n.org
Thu Sep 28 05:28:45 UTC 2006
> Peter Samuelson wrote:
> > } else {
> > + char *tmp = a2h[((unsigned)*inp) - 192];
> > + size_t tmpl = strlen(tmp);
> > + memcpy(outp, tmp, tmpl+1);
> > + outp += tmpl;
> > }
It occurred to me after sending this that I didn't actually know what
(unsigned)*inp would do. As it turns out, it sign-extends to int
_before_ interpreting as unsigned int, the opposite of what I had
expected.
So, yeah, please ignore anything I ever say about integer type casting,
as I clearly don't have a clue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/debburn-devel/attachments/20060928/98205c9a/attachment.pgp
More information about the Debburn-devel
mailing list