@@ -64,6 +64,7 @@ static int32_t dwim(JsonVariant v, int32_t def = 0) { // "Do What I Mean"
6464 }
6565}
6666
67+ /*
6768static void getFilename(JsonVariant v, char **ptr) {
6869 if(*ptr) { // If string already allocated,
6970 free(*ptr); // delete old value...
@@ -73,6 +74,7 @@ static void getFilename(JsonVariant v, char **ptr) {
7374 *ptr = strdup(v); // Make a copy of string, save that
7475 }
7576}
77+ */
7678
7779void loadConfig (char *filename) {
7880 File file;
@@ -135,7 +137,7 @@ void loadConfig(char *filename) {
135137 if (pMin > pMax) {
136138 float temp = pMin;
137139 pMin = pMax;
138- pMax = pMin ;
140+ pMax = temp ;
139141 }
140142 irisMin = (1.0 - pMax);
141143 irisRange = (pMax - pMin);
@@ -337,7 +339,7 @@ ImageReturnCode loadEyelid(char *filename,
337339 if (reader->bmpDimensions (filename, &w, &h) == IMAGE_SUCCESS) {
338340 tempBytes = ((w + 7 ) / 8 ) * h; // Bitmap size in bytes
339341 if (maxRam > tempBytes) {
340- if (tempPtr = (uint8_t *)malloc (maxRam - tempBytes)) {
342+ if (( tempPtr = (uint8_t *)malloc (maxRam - tempBytes)) != NULL ) {
341343 // Make SOME tempPtr reference, or optimizer removes the alloc!
342344 tempPtr[0 ] = 0 ;
343345 }
@@ -420,7 +422,7 @@ ImageReturnCode loadTexture(char *filename, uint16_t **data,
420422 if (reader->bmpDimensions (filename, &w, &h) == IMAGE_SUCCESS) {
421423 tempBytes = w * h * 2 ; // Image size in bytes (converted to 16bpp)
422424 if (maxRam > tempBytes) {
423- if (tempPtr = (uint8_t *)malloc (maxRam - tempBytes)) {
425+ if (( tempPtr = (uint8_t *)malloc (maxRam - tempBytes)) != NULL ) {
424426 // Make SOME tempPtr reference, or optimizer removes the alloc!
425427 tempPtr[0 ] = 0 ;
426428 }
0 commit comments