aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-25 17:31:47 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-25 17:31:47 +0000
commit444a01610c7dbb1f2d6ed832ef32844bcefc989d (patch)
treefc421363c2fe89875709698aaf3375f9518e55dd
parentbe7909f67000ac379839c4c204cb9b39f12402e7 (diff)
downloadtor-444a01610c7dbb1f2d6ed832ef32844bcefc989d.tar.gz
tor-444a01610c7dbb1f2d6ed832ef32844bcefc989d.zip
make the compile work (and not complain) on sunos 5.9
svn:r2312
-rw-r--r--src/common/util.c10
-rw-r--r--src/or/routerparse.c2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 6a162cf070..36a8048d2a 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -497,7 +497,7 @@ int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep,
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 @@ int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep,
}
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 @@ tv_udiff(struct timeval *start, struct timeval *end)
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;
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index c54097782e..c12d07f613 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -214,7 +214,7 @@ get_recommended_software_from_directory(const char *str)
comma = strchr(vl, ',');
version = tor_strndup(vl, comma?(comma-vl):strlen(vl));
cp = version;
- while (isspace(*cp))
+ while (isspace((int)*cp))
++cp;
if (!strncmp(cp, "Tor ", 4))
cp += 4;