X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fbs.c;h=f9572beb9e6de46ec7d243214717bf2bae981917;hp=ce74f566f5a7bbf1969b49c7f113bc0ab631efd1;hb=95a30fbbfc81d5eb0a76e139c86e0a6505cad871;hpb=027ae42953e3186daed8f3882da73de48291b606 diff --git a/test/bs.c b/test/bs.c index ce74f566..f9572beb 100644 --- a/test/bs.c +++ b/test/bs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +34,7 @@ * v2.0 featuring strict ANSI/POSIX conformance, November 1993. * v2.1 with ncurses mouse support, September 1995 * - * $Id: bs.c,v 1.44 2006/05/20 15:38:52 tom Exp $ + * $Id: bs.c,v 1.47 2008/08/03 18:30:28 tom Exp $ */ #include @@ -222,7 +222,7 @@ intro(void) if ((tmpname = getlogin()) != 0) { (void) strcpy(name, tmpname); - name[0] = toupper(name[0]); + name[0] = toupper(UChar(name[0])); } else (void) strcpy(name, dftname); @@ -459,12 +459,13 @@ initgame(void) do { c = getch(); } while - (!strchr("hjklrR", c) || c == FF); + (!(strchr("hjklrR", c) || c == FF)); if (c == FF) { (void) clearok(stdscr, TRUE); (void) refresh(); } else if (c == 'r') { + assert(ss != 0); prompt(1, "Random-placing your %s", ss->name); randomplace(PLAYER, ss); placeship(PLAYER, ss, TRUE); @@ -480,6 +481,7 @@ initgame(void) } error((char *) NULL); } else if (strchr("hjkl8462", c)) { + assert(ss != 0); ss->x = curx; ss->y = cury;