From: chaoskagami Date: Fri, 19 Aug 2016 22:19:12 +0000 (-0400) Subject: Fix bug in how CID is used (we don't want zero kept in the variable, wow me) X-Git-Tag: v0.3.0~46 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=73f061163dff2386ffb4011c684b6d1747b8a49f;p=corbenik%2Fcorbenik.git Fix bug in how CID is used (we don't want zero kept in the variable, wow me) --- diff --git a/source/config-file.c b/source/config-file.c index fbaa497..99a9584 100644 --- a/source/config-file.c +++ b/source/config-file.c @@ -4,7 +4,7 @@ FILE *conf_handle; struct config_file *config; extern uint8_t *enable_list; -char *config_file_path; +char *config_file_path = NULL; int changed_consoles = 0; uint32_t cid[4]; @@ -102,10 +102,11 @@ load_config() strcpy(config_file_path, SYSCONFDIR "/config-"); size_t len = strlen(config_file_path) + 7; - while (cid[0]) { + uint32_t cid_cp = cid[0]; + while (cid_cp) { static const char hexDigits[] = "0123456789ABCDEF"; - config_file_path[len--] = hexDigits[(uint32_t)(cid[0] & 0xF)]; - cid[0] >>= 4; + config_file_path[len--] = hexDigits[(uint32_t)(cid_cp & 0xF)]; + cid_cp >>= 4; } config = (struct config_file*)malloc(sizeof(struct config_file) + FCRAM_SPACING / 2);