summaryrefslogtreecommitdiff
path: root/src/map/HPMmap.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-20 04:36:08 +0100
committerHaru <haru@dotalux.com>2015-01-20 04:41:33 +0100
commit4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch)
treedab9d12a6a4b95a37598e27e6e86d6047360d61b /src/map/HPMmap.c
parent03709c136ad300be631adfd38dc36c2433bda718 (diff)
downloadhercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip
Minor fixes and tweaks suggested by cppcheck
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/HPMmap.c')
-rw-r--r--src/map/HPMmap.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index cb4e79108..f3a83ff0f 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -173,17 +173,15 @@ void HPM_map_do_init(void) {
}
void HPM_map_do_final(void) {
- unsigned char i;
-
- if( atcommand_list )
+ if (atcommand_list)
aFree(atcommand_list);
/**
* why is pcg->HPM being cleared here? because PCG's do_final is not final,
* is used on reload, and would thus cause plugin-provided permissions to go away
**/
- if( pcg->HPMpermissions )
- {
- for( i = 0; i < pcg->HPMpermissions_count; i++ ) {
+ if (pcg->HPMpermissions) {
+ unsigned char i;
+ for (i = 0; i < pcg->HPMpermissions_count; i++) {
aFree(pcg->HPMpermissions[i].name);
}
aFree(pcg->HPMpermissions);