[lua] Fix sensor max and min matching

Resolves #442
This commit is contained in:
Raphael Coeffic
2021-07-14 08:45:00 +02:00
parent f026670065
commit 6d11fa8033
3 changed files with 13 additions and 1 deletions
+10
View File
@@ -89,6 +89,16 @@ int zchar2str(char * dest, const char * src, int size)
return size+1;
}
int strnlen(const char *src, int max_size)
{
for (int i=0; i<max_size; i++) {
if (src[i] == '\0')
return i;
}
return max_size;
}
unsigned int effectiveLen(const char * str, unsigned int size)
{
while (size > 0) {