summaryrefslogtreecommitdiff
path: root/extras/gudev/gudevdevice.c
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-10-29 12:16:43 -0400
committerKay Sievers <kay.sievers@vrfy.org>2011-10-31 13:47:22 +0100
commit39649a8b3a1e7121a622dd3d01c0beb6b3da9b0b (patch)
tree51fa2623340ac3054d94f035c1b6bf5a9d2a3e9f /extras/gudev/gudevdevice.c
parent092a53bb92165e189b2c14ab5e21481a85b23475 (diff)
gudev: Use strtoul to parse unsigned 64-bit integers
Otherwise it will return 0x7fffffffffffffff instead of 0x8000000000000004 for e.g. this property ID_PART_ENTRY_FLAGS=0x8000000000000004 Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'extras/gudev/gudevdevice.c')
-rw-r--r--extras/gudev/gudevdevice.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/extras/gudev/gudevdevice.c b/extras/gudev/gudevdevice.c
index 6f30d12d07..e77b34bd50 100644
--- a/extras/gudev/gudevdevice.c
+++ b/extras/gudev/gudevdevice.c
@@ -538,7 +538,7 @@ out:
* @key: Name of property.
*
* Look up the value for @key on @device and convert it to an unsigned
- * 64-bit integer using strtoll().
+ * 64-bit integer using strtoul().
*
* Returns: The value for @key or 0 if @key doesn't exist or isn't a
* #guint64.
@@ -558,7 +558,7 @@ g_udev_device_get_property_as_uint64 (GUdevDevice *device,
if (s == NULL)
goto out;
- result = strtoll (s, NULL, 0);
+ result = strtoul (s, NULL, 0);
out:
return result;
}
@@ -756,7 +756,7 @@ out:
* @name: Name of the sysfs attribute.
*
* Look up the sysfs attribute with @name on @device and convert it to an unsigned
- * 64-bit integer using strtoll().
+ * 64-bit integer using strtoul().
*
* Returns: The value of the sysfs attribute or 0 if there is no such
* attribute.
@@ -776,7 +776,7 @@ g_udev_device_get_sysfs_attr_as_uint64 (GUdevDevice *device,
if (s == NULL)
goto out;
- result = strtoll (s, NULL, 0);
+ result = strtoul (s, NULL, 0);
out:
return result;
}