On 04/ 3/12 02:25 PM, Chase Douglas wrote:
> +static Bool
> +TryCreateSocket(int num, int *partial)
> +{
> + char port[20];
> +
> + sprintf(port, "%d", num);
> +
> + return (_XSERVTransMakeAllCOTSServerListeners(port, partial,
> + &ListenTransCount,
> + &ListenTransConns) >= 0);
> +}
> +
I'd prefer if this stayed with snprintf like the old code did:
> - snprintf(port, sizeof(port), "%d", atoi(display));
Not because there's any chance of it overflowing, but because it's one less
place we have to check to be sure sprintf can't overflow.
> + if (display) {
[...]
> + }
> + else { /* -displayfd */
I had to go digging through the code before I could be convinced this was
a safe assumption to make. Perhaps a comment somewhere like dix/globals.c
should state that display is initialized to "0" by main, and then set by
ProcessCommandLine to either a command line specified display, or in the
case of -displayfd to NULL, would be helpful for future understanding.
Definitely in favor of adding this support though, thanks for finishing it off.
--
-Alan Coopersmith- [email protected]
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel