Re: [Monetdb-developers] [Monetdb-checkins] MonetDB5/src/tools monetdb.mx, , 1.19, 1.20
31 Aug
2007
31 Aug
'07
5:19 p.m.
On 2007-08-31 19:14, Fabian wrote:
Update of /cvsroot/monetdb/MonetDB5/src/tools In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4192
Modified Files: monetdb.mx Log Message: reduce overkill
Index: monetdb.mx
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/monetdb.mx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- monetdb.mx 31 Aug 2007 17:09:13 -0000 1.19 +++ monetdb.mx 31 Aug 2007 17:14:21 -0000 1.20 @@ -610,7 +610,6 @@ }
if (stats != NULL) {
char path[8096]; err e; if (stats->state == SABdbRunning) {
@@ -627,11 +626,12 @@ }
if (force == 0) {
char answ; printf("you are about to remove database %s\n", dbname); printf("ALL data in this database will get lost, " "are you sure? [y/N] ");
scanf("%c", path);
if (path[0] == 'y' || path[0] == 'Y') {
scanf("%c", &answ);
if (answ == 'y' || answ == 'Y') { /* do it! */ } else { printf("battle control terminated\n");
Even better would be to use getchar(). scanf is still considerable overkill for reading a character. But also remember to read the rest of the line (also when using scanf).
--
Sjoerd Mullender
6091
Age (days ago)
6091
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sjoerd Mullender