- change order of if/else - move wpa_printf() into the condition - change unsigned char* to u8* - prefer os_memset/os_memcpy