fix trictly non-const strlen for const strings

found by q66 - strlen happende to work as the optimizer could deduce
this was a const value at compile time, but strictly it wasn't so use
sizeof instead.

@fix
This commit is contained in:
Carsten Haitzler 2023-12-26 23:26:38 +00:00 committed by Christopher Michael
parent b4ffc94023
commit e5af64a152
2 changed files with 2 additions and 2 deletions

View File

@ -976,7 +976,7 @@ struct _Escape_Value
size_t value_len;
};
#define ESCAPE_VALUE(e,v) {e,v,strlen(e),strlen(v)}
#define ESCAPE_VALUE(e,v) {e,v,sizeof(e)-1,sizeof(v)-1}
/**
* @internal

View File

@ -19,7 +19,7 @@ struct _Color_Name_Value
unsigned char b;
};
#define COLOR_NAME(name,r,g,b) {name,(unsigned char)strlen(name),r,g,b}
#define COLOR_NAME(name,r,g,b) {name,(unsigned char)sizeof(name)-1,r,g,b}
/**
* @internal