Explorar el Código

- Small change in the login-sql server that prevens crashes when somehow people change the lastlogin column to accept nulls.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10011 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex hace 18 años
padre
commit
fec9da329e
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      src/login_sql/login.c

+ 1 - 2
src/login_sql/login.c

@@ -875,8 +875,7 @@ int mmo_auth( struct mmo_account* account , int fd){
 	account->account_id = atoi(sql_row[0]);
 	account->login_id1 = rand();
 	account->login_id2 = rand();
-	memcpy(tmpstr, sql_row[3], 19);
-	memcpy(account->lastlogin, tmpstr, 24);
+	strncpy(account->lastlogin, sql_row[3], 24);
 	account->sex = sql_row[5][0] == 'S' ? 2 : sql_row[5][0]=='M';
 	account->level = atoi(sql_row[10]) > 99 ? 99 : atoi(sql_row[10]); // as was in isGM() [zzo]