[Xcb] Get rid of PATH_MAX and MAXPATHLEN
arnaud at andesi.org
Mon Apr 26 08:05:12 PDT 2010
Thanks much for the quick reply/review.
> I like the theory. Reliance on PATH_MAX is a good way to get
> burnt. An additional malloc/free at startup isn't going to hurt.
> That said, there are a couple of things that could be better about
> the implementation:
> 1) You need to check the return value of realloc.
> 2) Why + 1024? Magic constants should be named, at
> least. Something like "#define INITIAL_SOCKNAME_SLACK 1024" would
> be better.
Good idea, thanks. Fixed.
> 3) I don't trust that while loop. A broken getpeername/getsockname
> could send us off into an infinite loop. But I'm probably just
> being paranoid, so feel free to ignore this one.
I also thought about that when writing the code but I did nothing
because I assume that it will never happen. What do other people think
I have attached to this email a diff to the previous patch and the
Arnaud Fontaine (arnau)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1727 bytes
Desc: not available
More information about the Xcb