projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9211d2b
)
GSettings strinfo: byteswap integers
author
Ryan Lortie
<desrt@desrt.ca>
Mon, 4 Oct 2010 03:25:29 +0000
(23:25 -0400)
committer
Ryan Lortie
<desrt@desrt.ca>
Mon, 4 Oct 2010 03:25:29 +0000
(23:25 -0400)
strinfo is always strictly little endian, so ensure that we byteswap to
native when comparing and returning.
gio/strinfo.c
patch
|
blob
|
history
diff --git
a/gio/strinfo.c
b/gio/strinfo.c
index
84e4acf
..
6836b59
100644
(file)
--- a/
gio/strinfo.c
+++ b/
gio/strinfo.c
@@
-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;
}