diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-11-09 20:04:00 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-11-09 20:04:00 +0000 |
commit | 5a5be93f80a3cdb3d72311ece04ccc510c15626c (patch) | |
tree | e8c93b2cc57de810b0dfb0dc35a90727be4a57dc /src/common | |
parent | d9d053d70b23ef46610867298dabdec579cef9c4 (diff) | |
download | tor-5a5be93f80a3cdb3d72311ece04ccc510c15626c.tar.gz tor-5a5be93f80a3cdb3d72311ece04ccc510c15626c.zip |
Normalize whitespace; add a "tell me about all the unnormalized whitespace" target; fix a braino in dirserv.c
svn:r2758
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compat.c | 3 | ||||
-rw-r--r-- | src/common/crypto.c | 2 | ||||
-rw-r--r-- | src/common/log.c | 3 | ||||
-rw-r--r-- | src/common/log.h | 2 | ||||
-rw-r--r-- | src/common/torint.h | 3 | ||||
-rw-r--r-- | src/common/tortls.c | 1 | ||||
-rw-r--r-- | src/common/util.c | 17 |
7 files changed, 8 insertions, 23 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 457b798f7e..0b67820c6c 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2,7 +2,6 @@ /* See LICENSE for licensing information */ /* $Id$ */ - /* This is required on rh7 to make strptime not complain. */ #define _GNU_SOURCE @@ -488,7 +487,6 @@ void spawn_exit() #endif } - /** Set *timeval to the current time of day. On error, log and terminate. * (Same as gettimeofday(timeval,NULL), but never returns -1.) */ @@ -560,7 +558,6 @@ void tor_mutex_release(tor_mutex_t *m) } #endif - /** * On Windows, WSAEWOULDBLOCK is not always correct: when you see it, * you need to ask the socket for its actual errno. Also, you need to diff --git a/src/common/crypto.c b/src/common/crypto.c index 6b5c952be5..e779ceeade 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -99,7 +99,6 @@ RSA *_crypto_pk_env_get_rsa(crypto_pk_env_t *env); EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env, int private); DH *_crypto_dh_env_get_dh(crypto_dh_env_t *dh); - /** Return the number of bytes added by padding method <b>padding</b>. */ static INLINE int @@ -739,7 +738,6 @@ crypto_pk_private_sign_digest(crypto_pk_env_t *env, unsigned char *to, return crypto_pk_private_sign(env,to,digest,DIGEST_LEN); } - /** Perform a hybrid (public/secret) encryption on <b>fromlen</b> * bytes of data from <b>from</b>, with padding type 'padding', * storing the results on <b>to</b>. diff --git a/src/common/log.c b/src/common/log.c index c61d0a5d4a..7e351aed2a 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -124,7 +124,7 @@ static INLINE char *format_msg(char *buf, size_t buf_len, else n += r; } - + r = tor_vsnprintf(buf+n,buf_len-n,format,ap); if(r < 0) { n = buf_len-2; @@ -413,7 +413,6 @@ int get_min_log_level(void) return min; } - /* Local Variables: mode:c diff --git a/src/common/log.h b/src/common/log.h index c2a4ea176f..2f90ce8c48 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -27,7 +27,7 @@ /* XXXX Note: The code was originally written to refer to severities, * with 0 being the least severe; while syslog's logging code refers to * priorities, with 0 being the most important. Thus, all our comparisons - * needed to be reversed when we added syslog support. + * needed to be reversed when we added syslog support. * * The upshot of this is that comments about log levels may be messed * up: for "maximum severity" read "most severe" and "numerically diff --git a/src/common/torint.h b/src/common/torint.h index aec8d686ea..359f510d5a 100644 --- a/src/common/torint.h +++ b/src/common/torint.h @@ -33,7 +33,6 @@ #endif #endif - #if (SIZEOF_INT8_T != 0) #define HAVE_INT8_T #endif @@ -87,7 +86,6 @@ typedef unsigned short uint16_t; #endif #endif - #if (SIZEOF_INT == 2) #ifndef HAVE_INT16_T typedef signed int int16_t; @@ -111,7 +109,6 @@ typedef unsigned int uint32_t; #endif #endif - #if (SIZEOF_LONG == 4) #ifndef HAVE_INT32_T typedef signed long int32_t; diff --git a/src/common/tortls.c b/src/common/tortls.c index 051b9887df..a881ac575b 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -257,7 +257,6 @@ tor_tls_create_certificate(crypto_pk_env_t *rsa, return x509; } - #ifdef EVERYONE_HAS_AES /* Everybody is running OpenSSL 0.9.7 or later, so no backward compatibility * is needed. */ diff --git a/src/common/util.c b/src/common/util.c index d045de9c74..fbb92c0a4d 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -295,7 +295,6 @@ int strcmpend(const char *s1, const char *s2) return strncmp(s1+(n1-n2), s2, n2); } - /** Return a pointer to the first char of s that is not whitespace and * not a comment, or to the terminating NUL if no such character exists. */ @@ -351,8 +350,7 @@ const char *find_whitespace(const char *s) { err: \ if (ok) *ok = 0; \ if (next) *next = endptr; \ - return 0; \ - + return 0; /** Extract a long from the start of s, in the given numeric base. If * there is unconverted data and next is provided, set *next to the @@ -413,8 +411,6 @@ tor_parse_uint64(const char *s, int base, uint64_t min, CHECK_STRTOX_RESULT(); } - - void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen) { const char *end; @@ -469,7 +465,6 @@ int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen) return 0; } - /* ===== * Time * ===== */ @@ -527,7 +522,6 @@ void tv_addms(struct timeval *a, long ms) { a->tv_usec %= 1000000; } - #define IS_LEAPYEAR(y) (!(y % 4) && ((y % 100) || !(y % 400))) static int n_leapdays(int y1, int y2) { --y1; @@ -789,8 +783,9 @@ int write_str_to_file(const char *fname, const char *str, int bin) { #ifdef MS_WINDOWS - if (strchr(str, '\r')) { - log_fn(LOG_WARN, "How odd. Writing a string that does contain CR already."); + if (!bin && strchr(str, '\r')) { + log_fn(LOG_WARN, + "How odd. Writing a string that does contain CR already."); } #endif return write_bytes_to_file(fname, str, strlen(str), bin); @@ -865,7 +860,7 @@ char *read_file_to_str(const char *filename, int bin) { return NULL; } string[r] = '\0'; /* NUL-terminate the result. */ - + if (bin && r != statbuf.st_size) { /* If we're in binary mode, then we'd better have an exact match for * size. Otherwise, win32 encoding may throw us off, and that's okay. */ @@ -878,7 +873,7 @@ char *read_file_to_str(const char *filename, int bin) { #ifdef MS_WINDOWS if (!bin && strchr(string, '\r')) { log_fn(LOG_DEBUG, "We didn't convert CRLF to LF as well as we hoped when reading %s. Coping.", - filename); + filename); tor_strstrip(string, "\r"); } #endif |