summaryrefslogtreecommitdiff
path: root/client/mysqladmin.cc
diff options
context:
space:
mode:
authorStaale Smedseng <staale.smedseng@sun.com>2009-08-28 18:21:54 +0200
committerStaale Smedseng <staale.smedseng@sun.com>2009-08-28 18:21:54 +0200
commitf59ef9eafa076cd5d3ae3aedc609efa457492ebe (patch)
treea1ec5dfbd668a88bc0b6c98db397a421d2b37f21 /client/mysqladmin.cc
parenta0e44ec1e8d2352df6dbf40c959e2115c9884c7e (diff)
parent2217de25139f5994fc1c5c71f897ff0788813db0 (diff)
downloadmariadb-git-f59ef9eafa076cd5d3ae3aedc609efa457492ebe.tar.gz
Merge from 5.0 for 43414
Diffstat (limited to 'client/mysqladmin.cc')
-rw-r--r--client/mysqladmin.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index a4e7c5ad0c9..299be5a842f 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -1036,14 +1036,16 @@ static void usage(void)
static int drop_db(MYSQL *mysql, const char *db)
{
char name_buff[FN_REFLEN+20], buf[10];
+ char *input;
+
if (!option_force)
{
puts("Dropping the database is potentially a very bad thing to do.");
puts("Any data stored in the database will be destroyed.\n");
printf("Do you really want to drop the '%s' database [y/N] ",db);
fflush(stdout);
- VOID(fgets(buf,sizeof(buf)-1,stdin));
- if ((*buf != 'y') && (*buf != 'Y'))
+ input= fgets(buf, sizeof(buf)-1, stdin);
+ if (!input || ((*input != 'y') && (*input != 'Y')))
{
puts("\nOK, aborting database drop!");
return -1;