[seahorse/gnome-3-0] Fix problem importing SSH keys.



commit abef8bd54e56b3c7dbcaa9a839a49a3eb8f2374d
Author: Stef Walter <stefw collabora co uk>
Date:   Tue Apr 12 20:18:53 2011 +0200

    Fix problem importing SSH keys.
    
     * Files weren't being read completely.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=634064

 libseahorse/seahorse-util.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libseahorse/seahorse-util.c b/libseahorse/seahorse-util.c
index cd1d04d..2c7aec2 100644
--- a/libseahorse/seahorse-util.c
+++ b/libseahorse/seahorse-util.c
@@ -310,8 +310,11 @@ seahorse_util_read_to_memory (GInputStream *input, guint *len)
 	string = g_string_new ("");
 	buffer = g_new (gchar, size);
     
-	while (g_input_stream_read_all (input, buffer, size, &nread, NULL, NULL) && nread == size)
+	while (g_input_stream_read_all (input, buffer, size, &nread, NULL, NULL)) {
 		string = g_string_append_len (string, buffer, nread);
+		if (nread != size)
+			break;
+	}
 
 	if (len)
 		*len = string->len;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]