Fix windows build

svn:r2613
This commit is contained in:
Nick Mathewson 2004-10-27 18:14:38 +00:00
parent c5eb95b644
commit 6874c39904
4 changed files with 5 additions and 4 deletions

View File

@ -2346,7 +2346,7 @@ int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
r = vsnprintf(str, size, format, args); r = vsnprintf(str, size, format, args);
#endif #endif
str[size-1] = '\0'; str[size-1] = '\0';
if (r < 0 || r >= size) if (r < 0 || ((size_t)r) >= size)
return -1; return -1;
return r; return r;
} }

View File

@ -309,7 +309,7 @@ config_assign_line(or_options_t *options, struct config_line_t *c)
c->key = tor_strdup(var->name); c->key = tor_strdup(var->name);
} }
lvalue = ((void*)options) + var->var_offset; lvalue = ((char*)options) + var->var_offset;
switch(var->type) { switch(var->type) {
case CONFIG_TYPE_UINT: case CONFIG_TYPE_UINT:

View File

@ -511,8 +511,9 @@ list_server_status(char **running_routers_out, char **router_status_out)
SMARTLIST_FOREACH(descriptor_list, descriptor_entry_t *, d, SMARTLIST_FOREACH(descriptor_list, descriptor_entry_t *, d,
{ {
int is_live; int is_live;
connection_t *conn;
tor_assert(d->router); 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); d->router->identity_digest, CONN_TYPE_OR);
is_live = (conn && conn->state == OR_CONN_STATE_OPEN); is_live = (conn && conn->state == OR_CONN_STATE_OPEN);
smartlist_add(rr_entries, list_single_server_status(d, is_live, 1)); smartlist_add(rr_entries, list_single_server_status(d, is_live, 1));

View File

@ -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_TRANSIENT:
case RESOLVED_TYPE_ERROR: case RESOLVED_TYPE_ERROR:
buf[1] = 24; /* length of "error resolving hostname" */ 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; buflen = 26;
break; break;
default: default: