[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] make the compile work (and not complain) on sunos 5.9
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/common
Modified Files:
util.c
Log Message:
make the compile work (and not complain) on sunos 5.9
Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- util.c 24 Aug 2004 21:57:10 -0000 1.128
+++ util.c 25 Aug 2004 17:31:46 -0000 1.129
@@ -497,7 +497,7 @@
cp = str;
while (1) {
if (skipSpace) {
- while (isspace(*cp)) ++cp;
+ while (isspace((int)*cp)) ++cp;
}
end = strstr(cp,sep);
if (!end) {
@@ -508,7 +508,7 @@
}
if (skipSpace) {
- while (end > cp && isspace(*(end-1)))
+ while (end > cp && isspace((int)*(end-1)))
--end;
}
smartlist_add(sl, tor_strndup(cp, end-cp));
@@ -874,6 +874,12 @@
long udiff;
long secdiff = end->tv_sec - start->tv_sec;
+/* XXX some SunOS machines don't have LONG_MAX defined in the includes
+ * we use. Surely there is a better fix... */
+#ifndef LONG_MAX
+#define LONG_MAX 2147483647L
+#endif
+
if (secdiff+1 > LONG_MAX/1000000) {
log_fn(LOG_WARN, "comparing times too far apart.");
return LONG_MAX;