summaryrefslogtreecommitdiff
path: root/dbus/dbus-nonce.c
diff options
context:
space:
mode:
authorFrank Osterfeld <frank@kdab.net>2009-10-21 20:45:24 +0300
committerRalf Habacker <ralf.habacker@freenet.de>2009-12-01 08:43:45 +0100
commit0617102b4b156e40591e7af2a936a1988ef4b4d7 (patch)
tree9ddc2d70e3cafd36a58f1997152df27728ba8830 /dbus/dbus-nonce.c
parent9d27253f3660ebbb466f41cd2fa2f862999694b9 (diff)
downloaddbus-0617102b4b156e40591e7af2a936a1988ef4b4d7.tar.gz
Fixes to the nonce code
Cherry-picked from commit f9bc0f4bd036f6ede5d9850fb0f8587178c85f44 in the dbus4win repository, slightly massaged to apply by tml@iki.fi.
Diffstat (limited to 'dbus/dbus-nonce.c')
-rw-r--r--dbus/dbus-nonce.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dbus/dbus-nonce.c b/dbus/dbus-nonce.c
index 192c5101..8385340f 100644
--- a/dbus/dbus-nonce.c
+++ b/dbus/dbus-nonce.c
@@ -51,7 +51,7 @@ do_check_nonce (int fd, const DBusString *nonce, DBusError *error)
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
_dbus_string_free (&p);
_dbus_string_free (&buffer);
- return;
+ return FALSE;
}
while (nleft)
@@ -105,9 +105,10 @@ _dbus_read_nonce (const DBusString *fname, DBusString *nonce, DBusError* error)
{
FILE *fp;
char buffer[17];
- buffer[sizeof buffer - 1] = '\0';
size_t nread;
+ buffer[sizeof buffer - 1] = '\0';
+
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
_dbus_verbose ("reading nonce from file: %s\n", _dbus_string_get_const_data (fname));
@@ -355,6 +356,7 @@ _dbus_noncefile_delete (DBusNonceFile *noncefile,
_dbus_delete_file (&noncefile->path, error);
_dbus_string_free (&noncefile->dir);
_dbus_string_free (&noncefile->path);
+ return TRUE;
}
#else
@@ -389,6 +391,7 @@ _dbus_noncefile_delete (DBusNonceFile *noncefile,
_dbus_delete_directory (&noncefile->dir, error);
_dbus_string_free (&noncefile->dir);
_dbus_string_free (&noncefile->path);
+ return TRUE;
}
#endif