[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Fix a bug in last patch; and keep my name out of the assert...
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] Fix a bug in last patch; and keep my name out of the assert...
- From: nickm@xxxxxxxx (Nick Mathewson)
- Date: Tue, 21 Dec 2004 21:46:31 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Tue, 21 Dec 2004 21:46:53 -0500
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv709/src/common
Modified Files:
compat.c util.h
Log Message:
Fix a bug in last patch; and keep my name out of the assert() call too.
Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- compat.c 22 Dec 2004 02:32:26 -0000 1.23
+++ compat.c 22 Dec 2004 02:46:28 -0000 1.24
@@ -122,18 +122,19 @@
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
Index: util.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- util.h 22 Dec 2004 02:32:26 -0000 1.125
+++ util.h 22 Dec 2004 02:46:28 -0000 1.126
@@ -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