diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-26 10:37:45 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-26 10:37:45 +0000 |
commit | 49e9510c432987393d10ec1b8b1c2d416c9feb42 (patch) | |
tree | 4d930ebf1094ad5972cb8ba20b89d12ce74d4f3c /src/tool/adduser.c | |
parent | fda87bd7ef5a71f4f5d5e604de1b15c58763efdd (diff) | |
download | hercules-49e9510c432987393d10ec1b8b1c2d416c9feb42.tar.gz hercules-49e9510c432987393d10ec1b8b1c2d416c9feb42.tar.bz2 hercules-49e9510c432987393d10ec1b8b1c2d416c9feb42.tar.xz hercules-49e9510c432987393d10ec1b8b1c2d416c9feb42.zip |
Adjusted eAthena code to compile cleanly in C++ mode.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12436 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/tool/adduser.c')
-rw-r--r-- | src/tool/adduser.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tool/adduser.c b/src/tool/adduser.c index 8e7c5f0c2..2c7461930 100644 --- a/src/tool/adduser.c +++ b/src/tool/adduser.c @@ -9,19 +9,20 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> char *account_txt = "../save/account.txt"; //----------------------------------------------------- // Function to suppress control characters in a string. //----------------------------------------------------- -int remove_control_chars(unsigned char *str) +int remove_control_chars(char* str) { int i; int change = 0; for(i = 0; str[i]; i++) { - if (str[i] < 32) { + if (iscntrl((unsigned char)(str[i]))) { str[i] = '_'; change = 1; } @@ -64,7 +65,7 @@ int main(int argc, char *argv[]) } } } - close(FPaccin); + fclose(FPaccin); printf("File exists.\n"); printf("Don't create an account if the login-server is online!!!\n"); @@ -96,7 +97,7 @@ int main(int argc, char *argv[]) FPaccout = fopen(account_txt, "r+"); fseek(FPaccout, 0, SEEK_END); fprintf(FPaccout, "%i %s %s - %s -\r\n", next_id, username, password, sex); - close(FPaccout); + fclose(FPaccout); printf("Account added.\n"); } |