[Debburn-devel] [PATCH] fixes for aliasing bugs

Peter Samuelson peter at p12n.org
Wed Sep 27 22:26:49 UTC 2006


[Lorenz Minder]
>  		} else {
> -			strcpy((char *)outp, a2h[*inp-192]);
> -			outp += strlen(a2h[*inp-192]);
> +			strcpy(outp, a2h[((unsigned char)*inp) - 192]);
> +			outp += strlen(a2h[((unsigned char)*inp) -192]);
>  		}

That's really hard to read.  May I suggest temporary variables?

 		} else {
+			char *tmp = a2h[((unsigned)*inp) - 192];
+			size_t tmpl = strlen(tmp);
+			memcpy(outp, tmp, tmpl+1);
+			outp += tmpl;
 		}
-------------- 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/20060927/5d2e4dff/attachment.pgp


More information about the Debburn-devel mailing list