aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-27 18:14:38 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-27 18:14:38 +0000
commit6874c3990426ca4efd4e88796854f2bab60df54d (patch)
tree769be37eec77b9849dd88657985e7a3bda30701c
parentc5eb95b644284f3fc40d65e305386b84f65b92a2 (diff)
downloadtor-6874c3990426ca4efd4e88796854f2bab60df54d.tar.gz
tor-6874c3990426ca4efd4e88796854f2bab60df54d.zip
Fix windows build
svn:r2613
-rw-r--r--src/common/util.c2
-rw-r--r--src/or/config.c2
-rw-r--r--src/or/dirserv.c3
-rw-r--r--src/or/dns.c2
4 files changed, 5 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c
index e50d203130..3aa6d0bdd9 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2346,7 +2346,7 @@ int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
r = vsnprintf(str, size, format, args);
#endif
str[size-1] = '\0';
- if (r < 0 || r >= size)
+ if (r < 0 || ((size_t)r) >= size)
return -1;
return r;
}
diff --git a/src/or/config.c b/src/or/config.c
index c4dcf780ff..eb363f3eed 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -309,7 +309,7 @@ config_assign_line(or_options_t *options, struct config_line_t *c)
c->key = tor_strdup(var->name);
}
- lvalue = ((void*)options) + var->var_offset;
+ lvalue = ((char*)options) + var->var_offset;
switch(var->type) {
case CONFIG_TYPE_UINT:
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 9ebb56a57a..551c17f9f0 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -511,8 +511,9 @@ list_server_status(char **running_routers_out, char **router_status_out)
SMARTLIST_FOREACH(descriptor_list, descriptor_entry_t *, d,
{
int is_live;
+ connection_t *conn;
tor_assert(d->router);
- connection_t *conn = connection_get_by_identity_digest(
+ conn = connection_get_by_identity_digest(
d->router->identity_digest, CONN_TYPE_OR);
is_live = (conn && conn->state == OR_CONN_STATE_OPEN);
smartlist_add(rr_entries, list_single_server_status(d, is_live, 1));
diff --git a/src/or/dns.c b/src/or/dns.c
index 728845f260..913cb38892 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -159,7 +159,7 @@ static void send_resolved_cell(connection_t *conn, uint8_t answer_type)
case RESOLVED_TYPE_ERROR_TRANSIENT:
case RESOLVED_TYPE_ERROR:
buf[1] = 24; /* length of "error resolving hostname" */
- strlcpy(buf+2, "error resolving hostname", buf-2);
+ strlcpy(buf+2, "error resolving hostname", sizeof(buf)-2);
buflen = 26;
break;
default: