Removed unnecessary reference operator from scanf calls passing character strings as arguments in adduser tool.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14566 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Paradox924X 2010-12-07 19:24:03 +00:00
parent f95546e131
commit 45c05e45b7
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
Date Added Date Added
2010/12/07 2010/12/07
* Removed unnecessary reference operator from scanf calls passing character strings as arguments in adduser tool. [Paradox924X]
* Revert of r14564. The value wasn't an arbitrary account id but rather the file format version. Added comment specifying this. [Paradox924X] * Revert of r14564. The value wasn't an arbitrary account id but rather the file format version. Added comment specifying this. [Paradox924X]
* Removed arbitrary account id from atop account.txt (Since r13000). [Paradox924X] * Removed arbitrary account id from atop account.txt (Since r13000). [Paradox924X]
* Changed almost all instances of sprintf() to snprintf(). [Paradox924X] * Changed almost all instances of sprintf() to snprintf(). [Paradox924X]

View File

@ -75,7 +75,7 @@ int main(int argc, char *argv[])
strcpy(username, ""); strcpy(username, "");
while (strlen(username) < 4 || strlen(username) > 23) { while (strlen(username) < 4 || strlen(username) > 23) {
printf("Enter an username (4-23 characters): "); printf("Enter an username (4-23 characters): ");
scanf("%s", &username); scanf("%s", username);
username[23] = 0; username[23] = 0;
remove_control_chars(username); remove_control_chars(username);
} }
@ -83,7 +83,7 @@ int main(int argc, char *argv[])
strcpy(password, ""); strcpy(password, "");
while (strlen(password) < 4 || strlen(password) > 23) { while (strlen(password) < 4 || strlen(password) > 23) {
printf("Enter a password (4-23 characters): "); printf("Enter a password (4-23 characters): ");
scanf("%s", &password); scanf("%s", password);
password[23] = 0; password[23] = 0;
remove_control_chars(password); remove_control_chars(password);
} }
@ -91,7 +91,7 @@ int main(int argc, char *argv[])
strcpy(sex, ""); strcpy(sex, "");
while (strcmp(sex, "F") != 0 && strcmp(sex, "M") != 0) { while (strcmp(sex, "F") != 0 && strcmp(sex, "M") != 0) {
printf("Enter a gender (M for male, F for female): "); printf("Enter a gender (M for male, F for female): ");
scanf("%s", &sex); scanf("%s", sex);
} }
FPaccout = fopen(account_txt, "r+"); FPaccout = fopen(account_txt, "r+");