[or-cvs] Solaris CC freaks out if isspace and friends get anything o...

Nick Mathewson nickm at seul.org
Wed Dec 8 00:43:08 UTC 2004


Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv14849/src/or

Modified Files:
	directory.c 
Log Message:
Solaris CC freaks out if isspace and friends get anything other than an int.  We learned that, so we casted.  But it is also a bad idea to cast a signed char to an int and expect things to work on win32.  Now we cast to unsigned char, then to int, then pass to isspace. Ug

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- directory.c	5 Dec 2004 07:10:08 -0000	1.179
+++ directory.c	8 Dec 2004 00:42:50 -0000	1.180
@@ -472,7 +472,7 @@
   tor_assert(headers);
   tor_assert(code);
 
-  while (isspace((int)*headers)) headers++; /* tolerate leading whitespace */
+  while (TOR_ISSPACE(*headers)) headers++; /* tolerate leading whitespace */
 
   if (sscanf(headers, "HTTP/1.%d %d", &n1, &n2) < 2 ||
       (n1 != 0 && n1 != 1) ||



More information about the tor-commits mailing list