aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-11-18 11:00:16 -0500
committerNick Mathewson <nickm@torproject.org>2013-11-18 11:00:16 -0500
commitfbc20294aaf67f9434d5b1e107b8e1c43e42a3a4 (patch)
tree0d0f0b0aa37423e8f36f11e8410849e48be59ba6 /src/common/util.h
parent7a2b30fe16eacc040b3dd11f8c39c410628c2f43 (diff)
parentc81f64ab44f71a97649a44e10d6fcbf15aa8c835 (diff)
downloadtor-fbc20294aaf67f9434d5b1e107b8e1c43e42a3a4.tar.gz
tor-fbc20294aaf67f9434d5b1e107b8e1c43e42a3a4.zip
Merge branch 'backtrace_squashed'
Conflicts: src/common/sandbox.c src/common/sandbox.h src/common/util.c src/or/main.c src/test/include.am src/test/test.c
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/common/util.h b/src/common/util.h
index 3199ab1129..18dc20639f 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -48,13 +48,13 @@
/** Like assert(3), but send assertion failures to the log as well as to
* stderr. */
#define tor_assert(expr) STMT_BEGIN \
- if (PREDICT_UNLIKELY(!(expr))) { \
- log_err(LD_BUG, "%s:%d: %s: Assertion %s failed; aborting.", \
- SHORT_FILE__, __LINE__, __func__, #expr); \
- fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n", \
- SHORT_FILE__, __LINE__, __func__, #expr); \
- abort(); \
- } STMT_END
+ if (PREDICT_UNLIKELY(!(expr))) { \
+ tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr); \
+ abort(); \
+ } STMT_END
+
+void tor_assertion_failed_(const char *fname, unsigned int line,
+ const char *func, const char *expr);
/* If we're building with dmalloc, we want all of our memory allocation
* functions to take an extra file/line pair of arguments. If not, not.
@@ -524,7 +524,8 @@ int32_t tor_weak_random_range(tor_weak_rng_t *rng, int32_t top);
* <b>n</b> */
#define tor_weak_random_one_in_n(rng, n) (0==tor_weak_random_range((rng),(n)))
-int format_hex_number_sigsafe(unsigned int x, char *buf, int max_len);
+int format_hex_number_sigsafe(unsigned long x, char *buf, int max_len);
+int format_dec_number_sigsafe(unsigned long x, char *buf, int max_len);
#ifdef UTIL_PRIVATE
/* Prototypes for private functions only used by util.c (and unit tests) */