From 5eed8cc31d9ed6c6d2f4b6c844bc8208462d3d28 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 24 May 2011 13:35:48 +0400 Subject: [PATCH] fix kwallet auth on 64bit --- src/common/pwstorage/backend_kwallet.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/pwstorage/backend_kwallet.c b/src/common/pwstorage/backend_kwallet.c index 05da8f6..7c39d8c 100644 --- a/src/common/pwstorage/backend_kwallet.c +++ b/src/common/pwstorage/backend_kwallet.c @@ -101,13 +101,13 @@ static gchar* char2qstring(const gchar* in, gsize* size) out[i] = g_htons(out[i]); } - glong bytes = sizeof(gunichar2)*written; - glong BE_bytes = GINT_TO_BE(bytes); - *size = sizeof(glong)+bytes; + guint bytes = sizeof(gunichar2)*written; + guint BE_bytes = GUINT_TO_BE(bytes); + *size = sizeof(guint)+bytes; gchar* result = g_malloc(*size); - memcpy(result, &BE_bytes, sizeof(glong)); - memcpy(result+sizeof(glong), out, bytes); + memcpy(result, &BE_bytes, sizeof(guint)); + memcpy(result+sizeof(guint), out, bytes); return result; } @@ -340,11 +340,11 @@ gboolean dt_pwstorage_kwallet_set(const gchar* slot, GHashTable* table) static gchar* array2string(gchar* pos, guint* length) { memcpy(length, pos, sizeof(gint)); - *length = GINT_FROM_BE(*length); + *length = GUINT_FROM_BE(*length); pos += sizeof(gint); guint j; - for(j=0; j<*length/sizeof(gunichar2); j++) + for(j=0; j<((*length)/sizeof(gunichar2)); j++) { ((gunichar2*)pos)[j] = g_ntohs(((gunichar2*)pos)[j]); } -- 1.7.3.4