From 7a010beefe6fb4431fbcaaa6aad3ed9ccd99944c Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 19 Feb 2024 13:45:15 +0100 Subject: [PATCH] os: oscolor: fix BuiltinColor field naming The "name" field doesn't actually hold the color's name, but instead the offset of the name in the string table block. Thus, fix the field's name to reflect this. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- os/oscolor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os/oscolor.c b/os/oscolor.c index af83c6ada..837f433e5 100644 --- a/os/oscolor.c +++ b/os/oscolor.c @@ -56,7 +56,7 @@ typedef struct _builtinColor { unsigned char red; unsigned char green; unsigned char blue; - unsigned short name; + unsigned short name_offs; } BuiltinColor; static const char BuiltinColorNames[] = { @@ -1645,8 +1645,8 @@ OsLookupColor(int screen, while (high >= low) { mid = (low + high) / 2; c = &BuiltinColors[mid]; - r = strncasecmp(&BuiltinColorNames[c->name], name, len); - if (r == 0 && len == strlen(&BuiltinColorNames[c->name])) { + r = strncasecmp(&BuiltinColorNames[c->name_offs], name, len); + if (r == 0 && len == strlen(&BuiltinColorNames[c->name_offs])) { *pred = c->red * 0x101; *pgreen = c->green * 0x101; *pblue = c->blue * 0x101;