/* ************************************************************* */
-void
+int
changepw ()
{
char buf[21];
echo (); /* Putting echo back on just for safety and because it can't hurt. */
if (buf && *buf == '\0')
- return;
+ return 0;
if (strchr (buf, ':') != NULL)
graceful_exit (112);
me->password = strdup (crypt (buf, buf));
writefile (0);
+
+ return 1;
}
/* ************************************************************* */
for (i = 0; i < strlen (buf); i++)
{
- if (!isalnum(buf))
+ if (!isalnum(buf[i]))
error = 1;
}
clear ();
- changepw (); /* Calling changepw instead to prompt twice. */
+ if (!changepw ()) /* Calling changepw instead to prompt twice. */
+ {
+ free(me);
+ me = NULL;
+ return;
+ }
/* email step */
extern void drawbanner (unsigned int start_line, unsigned int howmany);
extern struct dg_game **populate_games (int *l);
extern void inprogressmenu (void);
-extern void changepw (void);
+extern int changepw (void);
extern void domailuser (char *username);
extern void drawmenu (void);
extern void freefile (void);