From: Jeremy Tan Date: Wed, 4 Sep 2013 12:05:08 +0000 (+0800) Subject: Merge branch 'master' of https://github.com/szmoore/MCTX3420.git X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=8d2b79e26696ee059454a41c91cb272b5d5faa00;hp=06b298efc180cff5fbbe98deb2248c4ca5cfaadc;p=matches%2FMCTX3420.git Merge branch 'master' of https://github.com/szmoore/MCTX3420.git --- diff --git a/server/fastcgi.c b/server/fastcgi.c index 29e85d3..2da4b12 100644 --- a/server/fastcgi.c +++ b/server/fastcgi.c @@ -265,6 +265,9 @@ void FCGI_RejectJSON(FCGIContext *context) */ void FCGI_RejectJSONEx(FCGIContext *context, StatusCodes status, const char *description) { + description = !description ? "" : description; + + Log(LOGINFO, "%s: Rejected query with: %d: %s", context->current_module, status, description); FCGI_BeginJSON(context, status); FCGI_JSONPair("description", description); FCGI_JSONLong("responsenumber", context->response_number); diff --git a/server/sensor.c b/server/sensor.c index 8115a3b..2e0749e 100644 --- a/server/sensor.c +++ b/server/sensor.c @@ -12,7 +12,7 @@ /** Array of sensors, initialised by Sensor_Init **/ static Sensor g_sensors[NUMSENSORS]; //global to this file -static const char * g_sensor_names[] = {"analog_test0","analog_test1","digital_test0"}; +static const char * g_sensor_names[] = {"analog_test0","analog_test1","digital_test0","digital_test1"}; /** * Read a data value from a sensor; block until value is read * @param sensor_id - The ID of the sensor @@ -195,7 +195,7 @@ Sensor * Sensor_Identify(const char * id_str) return NULL; } // Bounds check - if (id < 0 || id > NUMSENSORS) + if (id < 0 || id >= NUMSENSORS) return NULL;