Fix a bug in last patch; and keep my name out of the assert() call too.

svn:r3200
This commit is contained in:
Nick Mathewson
2004-12-22 02:46:28 +00:00
parent 32978afa54
commit c79c4200f4
2 changed files with 8 additions and 6 deletions
+6 -5
View File
@@ -122,18 +122,19 @@ int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
const char *
_tor_fix_source_file(const char *fname)
{
const char *cp1, *cp2;
const char *cp1, *cp2, *r;
cp1 = strrchr(fname, '/');
cp2 = strrchr(fname, '\\');
if (cp1 && cp2) {
return (cp1<cp2)?(cp2+1):(cp1+1);
r = (cp1<cp2)?(cp2+1):(cp1+1);
} else if (cp1) {
return cp1+1;
r = cp1+1;
} else if (cp2) {
return cp2+2;
r = cp2+1;
} else {
return fname;
r = fname;
}
return r;
}
#ifndef UNALIGNED_INT_ACCESS_OK
+2 -1
View File
@@ -40,7 +40,8 @@
if (!(expr)) { \
log(LOG_ERR, "%s:%d: %s: Assertion %s failed; aborting.", \
_SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \
assert(expr); /* write to console too. */ \
fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n", \
_SHORT_FILE_, __LINE__, __FUNCTION__, #expr); \
abort(); /* unreached */ \
} } while (0)
#endif