From 3188738be5ee78651e31c1340fac7fed81bbefb5 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 7 Jan 2016 16:47:24 +0100 Subject: Removed several unnecessary RFIFOP typecasts - While this is arguable, those explicit typecasts are potentially dangerous/misleading (for example, a const specifier might get accidentally dropped without even generating a compiler warning, or a variable type might change during code changes, and any related warning would get silenced by the explicit typecast). - As a reminder Hercules is written in C, and not in C++ (and there's no such thing as "compiling in C++ mode" - they're two different languages.) As such, it is legal to let the compiler automatically promote void* from/to any non-const pointer type, as well as const void* from/to any const pointer type. Signed-off-by: Haru --- src/login/account_sql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/login/account_sql.c') diff --git a/src/login/account_sql.c b/src/login/account_sql.c index cb6fdba99..be797c443 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -719,7 +719,7 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) { for (i = 0; i < count; i++) { unsigned int index; int len = RFIFOB(fd, cursor); - safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(key), len)); + safestrncpy(key, RFIFOP(fd, cursor + 1), min((int)sizeof(key), len)); cursor += len + 1; index = RFIFOL(fd, cursor); @@ -739,7 +739,7 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) { /* str */ case 2: len = RFIFOB(fd, cursor); - safestrncpy(sval, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len)); + safestrncpy(sval, RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len)); cursor += len + 1; if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%s')", db->global_acc_reg_str_db, account_id, key, index, sval) ) Sql_ShowDebug(sql_handle); -- cgit v1.2.3-60-g2f50