mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 12:50:04 +01:00
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 <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1313>
This commit is contained in:
parent
fdf483d862
commit
7a010beefe
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue