Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/fsplit Assert equality, not assignment, in fsplit, a...
details: https://anonhg.NetBSD.org/src/rev/9627b1809417
branches: trunk
changeset: 784273:9627b1809417
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jan 23 20:39:46 2013 +0000
description:
Assert equality, not assignment, in fsplit, and say who guarantees it.
diffstat:
usr.bin/fsplit/fsplit.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (25 lines):
diff -r 29e6f19c6d33 -r 9627b1809417 usr.bin/fsplit/fsplit.c
--- a/usr.bin/fsplit/fsplit.c Wed Jan 23 20:38:27 2013 +0000
+++ b/usr.bin/fsplit/fsplit.c Wed Jan 23 20:39:46 2013 +0000
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "from: @(#)fsplit.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: fsplit.c,v 1.28 2011/09/16 15:39:26 joerg Exp $");
+__RCSID("$NetBSD: fsplit.c,v 1.29 2013/01/23 20:39:46 riastradh Exp $");
#endif
#endif /* not lint */
@@ -235,9 +235,10 @@
}
strlcpy(fname, name, sizeof(fname));
fnamelen = strlen(fname);
+ /* Guaranteed by scan_name. */
assert(fnamelen > 2);
- assert(fname[fnamelen-2] = '.');
- assert(fname[fnamelen-1] = 'f');
+ assert(fname[fnamelen-2] == '.');
+ assert(fname[fnamelen-1] == 'f');
fname[fnamelen-2] = '\0';
for (i = 0; i < numextonly; i++) {
Home |
Main Index |
Thread Index |
Old Index