summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-10-14 02:47:09 +0000
committerRoger Dingledine <arma@torproject.org>2004-10-14 02:47:09 +0000
commitaebc3a03ba6eea02f4d50fa4bd5dbf49cd37a0c7 (patch)
treebd0b81c8f1021d0b8150cd32ba41b4c6c5489e78 /src/or/routerparse.c
parent92bb360ad771a4cba21f1e4a77e367f973e546ef (diff)
downloadtor-aebc3a03ba6eea02f4d50fa4bd5dbf49cd37a0c7.tar.gz
tor-aebc3a03ba6eea02f4d50fa4bd5dbf49cd37a0c7.zip
more int to size_t conversions, fixing one or more amd64 bugs
plus a whitespace patch on config.c from vicman svn:r2482
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index b29f835794..9ccc7300a8 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -59,7 +59,7 @@ typedef struct directory_token_t {
int n_args; /**< Number of elements in args */
char **args; /**< Array of arguments from keyword line. */
char *object_type; /**< -----BEGIN [object_type]-----*/
- int object_size; /**< Bytes in object_body */
+ size_t object_size; /**< Bytes in object_body */
char *object_body; /**< Contents of object, base64-decoded. */
crypto_pk_env_t *key; /**< For public keys only. */
char *error; /**< For _ERR tokens only. */
@@ -173,7 +173,7 @@ get_recommended_software_from_directory(const char *str)
{
#define REC "recommended-software "
const char *cp = str, *eol;
- int len = strlen(REC);
+ size_t len = strlen(REC);
cp = str;
if (strcmpstart(str, REC)==0) {
cp += len;
@@ -611,7 +611,6 @@ static int check_directory_signature(const char *digest,
char signed_digest[PK_BYTES];
routerinfo_t *r;
crypto_pk_env_t *_pkey = NULL;
-
if (tok->n_args != 1) {
log_fn(LOG_WARN, "Too many or too few arguments to directory-signature");
@@ -621,7 +620,7 @@ static int check_directory_signature(const char *digest,
if (declared_key) {
if (dir_signing_key_is_trusted(declared_key))
_pkey = declared_key;
- }
+ }
if (!_pkey) {
r = router_get_by_nickname(tok->args[0]);
log_fn(LOG_DEBUG, "Got directory signed by %s", tok->args[0]);
@@ -661,7 +660,6 @@ static int check_directory_signature(const char *digest,
return 0;
}
-
/** Given a string *<b>s</b> containing a concatenated sequence of router
* descriptors, parses them and stores the result in *<b>dest</b>. If
* good_nickname_list is provided, then routers are marked as
@@ -941,7 +939,8 @@ router_parse_exit_policy_from_string(const char *s)
const char *cp;
char *tmp;
struct exit_policy_t *r;
- int len, idx;
+ size_t len;
+ int idx;
/* *s might not end with \n, so we need to extend it with one. */
len = strlen(s);
@@ -1122,7 +1121,6 @@ policy_read_failed:
* Low-level tokenizer for router descriptors and directories.
*/
-
/** Free all resources allocated for <b>tok</b> */
static void
token_free(directory_token_t *tok)