diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-06-15 17:25:53 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-06-15 17:28:26 -0400 |
commit | 7b54d7ebbd963a0a40b6ff5109ea0e3eedde534d (patch) | |
tree | d7a0cbfd83a86dc32722ec090e05aca3e477ccc9 /src/common/compat.c | |
parent | 327d4c11ddbed709b3cca5bb12265f201797d569 (diff) | |
download | tor-7b54d7ebbd963a0a40b6ff5109ea0e3eedde534d.tar.gz tor-7b54d7ebbd963a0a40b6ff5109ea0e3eedde534d.zip |
Mark src/common tor_assert(0)/tor_fragile_assert() unreached for coverage
I audited this to make sure I was only marking ones that really
should be unreachable.
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 9d49b8ff44..023325bf57 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -526,8 +526,10 @@ tor_asprintf(char **strp, const char *fmt, ...) r = tor_vasprintf(strp, fmt, args); va_end(args); if (!*strp || r < 0) { + /* LCOV_EXCL_START */ log_err(LD_BUG, "Internal error in asprintf"); tor_assert(0); + /* LCOV_EXCL_STOP */ } return r; } @@ -2976,11 +2978,12 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf, /* If we get here, then gmtime/localtime failed without getting an extreme * value for *timep */ - + /* LCOV_EXCL_START */ tor_fragile_assert(); r = resultbuf; memset(resultbuf, 0, sizeof(struct tm)); outcome="can't recover"; + /* LCOV_EXCL_STOP */ done: log_warn(LD_BUG, "%s("I64_FORMAT") failed with error %s: %s", islocal?"localtime":"gmtime", |