fallthrough cases. now if direction turns up wrong (it should
not, but this code can't tell that, and convert it to an enum
that would also fix this, is more effort than this is worth.
-/* $NetBSD: room.c,v 1.13 2011/05/23 22:44:18 joerg Exp $ */
+/* $NetBSD: room.c,v 1.14 2019/10/05 23:34:14 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)room.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: room.c,v 1.13 2011/05/23 22:44:18 joerg Exp $");
+__RCSID("$NetBSD: room.c,v 1.14 2019/10/05 23:34:14 mrg Exp $");
#endif
#endif /* not lint */
case WEST:
return ("right");
}
+ break;
case SOUTH:
switch (direction) {
case WEST:
return ("left");
}
+ break;
case EAST:
switch (direction) {
return (option == '+' ? "behind you" :
"back");
}
+ break;
case WEST:
switch (direction) {
case WEST:
return ("ahead");
}
-
- default:
- printf("Error: room %d. More than four directions wanted.",
- position);
- return ("!!");
+ break;
}
+
+ printf("Error: room %d. More than four directions wanted.",
+ position);
+ return ("!!");
}
void