From: John Hodge Date: Wed, 15 Apr 2015 06:29:14 +0000 (+0800) Subject: (bugfix) Insufficient warning level to catch that bug X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=0a03be34434e860a0baf2e8657b622e8c4f23d86;p=tpg%2Fopendispense2.git (bugfix) Insufficient warning level to catch that bug --- diff --git a/src/server/handler_coke.c b/src/server/handler_coke.c index a52e373..b499387 100644 --- a/src/server/handler_coke.c +++ b/src/server/handler_coke.c @@ -53,7 +53,7 @@ const char *gsCoke_ModbusAddress = "130.95.13.73"; modbus_t *gCoke_Modbus; time_t gtCoke_LastDispenseTime; time_t gtCoke_LastReconnectTime; - int gbCoke_DummyMode = 1; +bool gbCoke_DummyMode = 1; int giCoke_NextCokeSlot = 0; // == CODE === @@ -61,11 +61,7 @@ int Coke_InitHandler() { // Configuable dummy/blank mode (all dispenses succeed) // TODO: Find a better way of handling missing/invalid options - if( Config_GetValueCount("coke_dummy_mode") > 0 ) - { - gbCoke_DummyMode = Config_GetValue_Bool("coke_dummy_mode", 0); - if(gbCoke_DummyMode == -1) gbCoke_DummyMode = 0; - } + Config_GetValue_Bool("coke_dummy_mode", &gbCoke_DummyMode); // Open modbus if( !gbCoke_DummyMode )