blob: 8833169eb1ff2da03632d56566927db0c0d9cfca (
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.6 2004/11/07 13:19:24 jmmv Exp $
--- libseahorse/seahorse-util.c.orig 2004-10-14 11:40:11.000000000 -0600
+++ libseahorse/seahorse-util.c
@@ -226,11 +226,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, TRUE, &err);
if(file != NULL)
@@ -270,11 +271,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);
|