Re: Some patches for DIX

Keith Packard <[email protected]>
Newsgroups gmane.comp.freedesktop.xserver
Message-ID <[email protected]>
Your mieq.c patch looks fine; it's amazing that it's taken that long to be 
noticed.  Meanwhile, DIX has quite a collection of hacks to try and solve 
the same thing.  I note that the DIX hacks are actually wrong; time
comparisons should always be done as:

	if ((long) (a - b) > 0)		/* a is later than b */

The OS patch uses a relatively new C library function strspn, I'd rather 
just see code that walks the string and bails if there's something invalid.

Does this look right?

	if (d[0] == '0' && d[1] != '\0') return 0;
	while (*d)
		if (strchr ("0123456789", *d++) == 0) return 0;
	return 1;

-keith
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh version 2.3.1 11/28/2001

iD8DBQFARlrgQp8BWwlsTdMRAkSFAJsGEO6BqQw7ejqlcm7DLohK0JTWQgCcDcRD
HltqJoEcehdhOpVY7VgHofk=
=m7PA
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.