diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compat.c | 8 | ||||
-rw-r--r-- | src/common/container.c | 2 | ||||
-rw-r--r-- | src/common/crypto.c | 12 | ||||
-rw-r--r-- | src/common/util.c | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 16e1bee4b6..029622b4d2 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -112,7 +112,7 @@ int tor_vsnprintf(char *str, size_t size, const char *format, va_list args) #ifndef UNALIGNED_INT_ACCESS_OK /** - * Read a 16-bit value beginning at <b>cp</b>. Equaivalent to + * Read a 16-bit value beginning at <b>cp</b>. Equivalent to * *(uint16_t*)(cp), but will not cause segfaults on platforms that forbid * unaligned memory access. */ @@ -123,7 +123,7 @@ uint16_t get_uint16(const char *cp) return v; } /** - * Read a 32-bit value beginning at <b>cp</b>. Equaivalent to + * Read a 32-bit value beginning at <b>cp</b>. Equivalent to * *(uint32_t*)(cp), but will not cause segfaults on platforms that forbid * unaligned memory access. */ @@ -249,7 +249,7 @@ tor_socketpair(int family, int type, int protocol, int fd[2]) memset(&listen_addr, 0, sizeof(listen_addr)); listen_addr.sin_family = AF_INET; listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - listen_addr.sin_port = 0; /* kernel choses port. */ + listen_addr.sin_port = 0; /* kernel chooses port. */ if (bind(listener, (struct sockaddr *) &listen_addr, sizeof (listen_addr)) == -1) goto tidy_up_and_fail; @@ -646,7 +646,7 @@ struct { int code; const char *msg; } windows_socket_errors[] = { E(WSAENETRESET, "Network dropped connection on reset"), E(WSAECONNABORTED, "Software caused connection abort"), E(WSAECONNRESET, "Connection reset by peer"), - E(WSAENOBUFS, "No buffer space avaialable"), + E(WSAENOBUFS, "No buffer space available"), E(WSAEISCONN, "Socket is already connected"), E(WSAENOTCONN, "Socket is not connected"), E(WSAESHUTDOWN, "Cannot send after socket shutdown"), diff --git a/src/common/container.c b/src/common/container.c index a13b20b1ce..0ee53a0fba 100644 --- a/src/common/container.c +++ b/src/common/container.c @@ -242,7 +242,7 @@ void smartlist_insert(smartlist_t *sl, int idx, void *val) } /** - * Split a string <b>str</b> along all occurences of <b>sep</b>, + * Split a string <b>str</b> along all occurrences of <b>sep</b>, * adding the split strings, in order, to <b>sl</b>. If * <b>flags</b>&SPLIT_SKIP_SPACE is true, remove initial and * trailing space from each entry. If diff --git a/src/common/crypto.c b/src/common/crypto.c index 25366883ca..a299a0ea13 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1078,7 +1078,7 @@ crypto_cipher_decrypt(crypto_cipher_env_t *env, unsigned char *to, } /** Move the position of the cipher stream backwards by <b>delta</b> bytes. - * Return 0 on suuccess, -1 on failure. + * Return 0 on success, -1 on failure. */ int crypto_cipher_rewind(crypto_cipher_env_t *env, long delta) @@ -1087,7 +1087,7 @@ crypto_cipher_rewind(crypto_cipher_env_t *env, long delta) } /** Move the position of the cipher stream forwards by <b>delta</b> bytes. - * Return 0 on suuccess, -1 on failure. + * Return 0 on success, -1 on failure. */ int crypto_cipher_advance(crypto_cipher_env_t *env, long delta) @@ -1100,7 +1100,7 @@ crypto_cipher_advance(crypto_cipher_env_t *env, long delta) /** Compute the SHA1 digest of <b>len</b> bytes in data stored in * <b>m</b>. Write the DIGEST_LEN byte result into <b>digest</b>. - * Return 0 on suuccess, -1 on failure. + * Return 0 on success, -1 on failure. */ int crypto_digest(unsigned char *digest, const unsigned char *m, int len) { @@ -1388,7 +1388,7 @@ void crypto_dh_free(crypto_dh_env_t *dh) /* random numbers */ /** Seed OpenSSL's random number generator with DIGEST_LEN bytes from the - * operating system. Return 0 on suuccess, -1 on failure. + * operating system. Return 0 on success, -1 on failure. */ int crypto_seed_rng(void) { @@ -1417,7 +1417,7 @@ int crypto_seed_rng(void) return -1; } RAND_seed(buf, DIGEST_LEN); - /* And add the current screen state to the entopy pool for + /* And add the current screen state to the entropy pool for * good measure. */ RAND_screen(); return 0; @@ -1474,7 +1474,7 @@ void crypto_pseudo_rand(unsigned char *to, unsigned int n) } } -/** Return a pseudorandom integer, choosen uniformly from the values +/** Return a pseudorandom integer, chosen uniformly from the values * between 0 and max-1. */ int crypto_pseudo_rand_int(unsigned int max) { unsigned int val; diff --git a/src/common/util.c b/src/common/util.c index 678ae3bd52..169dbf14bd 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -168,7 +168,7 @@ char *tor_strndup(const char *s, size_t n) { char *dup; tor_assert(s); dup = tor_malloc(n+1); - /* Performance note: Ordinarly we prefer strlcpy to strncpy. But + /* Performance note: Ordinarily we prefer strlcpy to strncpy. But * this function gets called a whole lot, and platform strncpy is * much faster than strlcpy when strlen(s) is much longer than n. */ @@ -256,7 +256,7 @@ int tor_strpartition(char *dest, size_t dest_len, return 0; } -/** Return a pointer to a NUL-terminated hexidecimal string encoding +/** Return a pointer to a NUL-terminated hexadecimal string encoding * the first <b>fromlen</b> bytes of <b>from</b>. (fromlen must be \<= 32.) The * result does not need to be deallocated, but repeated calls to * hex_str will trash old results. @@ -385,7 +385,7 @@ const char *find_whitespace(const char *s) { * are converted; or if there are unconverted characters and next is NULL; or * if the parsed value is not between min and max. When no error occurs, * return the parsed value and set *ok (if provided) to 1. When an error - * ocurs, return 0 and set *ok (if provided) to 0. + * occurs, return 0 and set *ok (if provided) to 0. */ long tor_parse_long(const char *s, int base, long min, long max, |