#include <afs/afsutil.h>
#include <ubik.h>
+#include <ctype.h>
+
#include "uss_vol.h" /*Interface to this module */
#include "uss_common.h" /*Common definitions */
#include "uss_procs.h" /*Defs from procs module */
char *Oldmpoint = NULL; /*Old mountpoint name, if any */
char tmp_str[uss_MAX_SIZE]; /*Useful string buffer */
int o; /*Owner's user id */
- char userinput[64]; /*User's input */
+ int checkch, ch; /*Read user's confirmation input */
struct uss_subdir *new_dir; /*Used to remember original ACL */
/*
printf
("Overwrite files in pre-existing '%s' volume? [y, n]: ",
a_volname);
- scanf("%s", userinput);
- if ((userinput[0] == 'y') || (userinput[0] == 'Y')) {
+ checkch = ch = ' ';
+ while (isspace(ch))
+ checkch = ch = getchar();
+ while (ch != '\n' && ch != EOF)
+ ch = getchar();
+ if (checkch == 'y' || checkch == 'Y') {
printf("\t[Overwriting allowed]\n");
uss_OverwriteThisOne = 1;
} else