mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Compile cleanly with when _FORTIFY_SOURCE is defined. This definition
is forced when building RPMs on FC4. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13333 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -254,8 +254,10 @@ gsf_output_stdio_close (GsfOutput *output)
|
||||
stdio->st.st_uid,
|
||||
stdio->st.st_gid)) {
|
||||
/* We cannot set both. Maybe we can set one. */
|
||||
chown (stdio->real_filename, -1, stdio->st.st_gid);
|
||||
chown (stdio->real_filename, stdio->st.st_uid, -1);
|
||||
if (!chown (stdio->real_filename, -1, stdio->st.st_gid)) {
|
||||
gint dc; /* Don't care */
|
||||
dc = chown (stdio->real_filename, stdio->st.st_uid, -1);
|
||||
}
|
||||
}
|
||||
chmod_wrapper (stdio->real_filename, stdio->st.st_mode);
|
||||
#endif
|
||||
|
||||
@@ -130,7 +130,7 @@ void
|
||||
gsf_input_dump (GsfInput *input, gboolean dump_as_hex)
|
||||
{
|
||||
gsf_off_t offset = 0;
|
||||
size_t size, count;
|
||||
size_t size, count, count2, written;
|
||||
guint8 const *data;
|
||||
|
||||
/* read in small blocks to excercise things */
|
||||
@@ -143,8 +143,13 @@ gsf_input_dump (GsfInput *input, gboolean dump_as_hex)
|
||||
g_return_if_fail (data != NULL);
|
||||
if (dump_as_hex)
|
||||
gsf_mem_dump_full (data, count, offset);
|
||||
else
|
||||
fwrite (data, 1, count, stdout);
|
||||
else {
|
||||
count2 = count;
|
||||
do {
|
||||
written = fwrite (data, 1, count2, stdout);
|
||||
count2 -= written;
|
||||
} while (count2 > 0);
|
||||
}
|
||||
size -= count;
|
||||
offset += count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user