summaryrefslogtreecommitdiff
path: root/security/seahorse/patches/patch-aa
blob: 138dc80b2395bbd91cc7ff85e99c254a4699d81b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$NetBSD: patch-aa,v 1.7 2005/05/19 21:14:11 jmmv Exp $

--- libseahorse/seahorse-util.c.orig	2005-05-01 19:30:09.000000000 +0000
+++ libseahorse/seahorse-util.c
@@ -230,11 +230,12 @@ seahorse_util_write_data_to_file (const 
 	gchar *buffer;
 	gint nread;
    
-    /* 
-     * TODO: gpgme_data_seek doesn't work for us right now
-     * probably because of different off_t sizes 
-     */
-    gpgme_data_rewind (data);
+    /* Reset the read pointer in data */
+    if (gpgme_data_seek (data, 0, SEEK_SET) == -1)
+    {
+        gpg_err_code_t e = gpg_err_code_from_errno (errno);
+        return GPG_E (e);
+    }
 	
     file = seahorse_vfs_data_create (path, SEAHORSE_VFS_WRITE, &err);
     if (file != NULL) {
@@ -275,11 +276,11 @@ seahorse_util_write_data_to_text (gpgme_
     guint nread = 0;
 	GString *string;
 
-    /* 
-     * TODO: gpgme_data_seek doesn't work for us right now
-     * probably because of different off_t sizes 
-     */
-    gpgme_data_rewind (data);
+        /* Reset the read pointer in data */
+        if (gpgme_data_seek (data, 0, SEEK_SET) == -1)
+        {
+            return NULL;
+        }
 
 	string = g_string_new ("");
 	buffer = g_new (gchar, size);