mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
GSettings strinfo: byteswap integers
strinfo is always strictly little endian, so ensure that we byteswap to native when comparing and returning.
This commit is contained in:
parent
9211d2b00c
commit
61563d5f55
@ -193,7 +193,7 @@ strinfo_find_integer (const guint32 *strinfo,
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
if (strinfo[i] == value)
|
||||
if (strinfo[i] == GUINT32_TO_LE (value))
|
||||
{
|
||||
const guchar *charinfo = (const guchar *) &strinfo[i];
|
||||
|
||||
@ -226,7 +226,7 @@ strinfo_enum_from_string (const guint32 *strinfo,
|
||||
if (index < 0)
|
||||
return FALSE;
|
||||
|
||||
*result = strinfo[index];
|
||||
*result = GUINT32_FROM_LE (strinfo[index]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user