summaryrefslogtreecommitdiffstats
path: root/tools/h5jam/h5unjam.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5jam/h5unjam.c')
-rw-r--r--tools/h5jam/h5unjam.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c
index 8e4eac4..8f88398 100644
--- a/tools/h5jam/h5unjam.c
+++ b/tools/h5jam/h5unjam.c
@@ -347,17 +347,19 @@ done:
* Returns 0 on success, -1 on failure.
*/
herr_t
-copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much )
+copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much )
{
static char buf[COPY_BUF_SIZE];
+ size_t how_much;
off_t where = (off_t)_where;
off_t to;
off_t from;
herr_t ret_value = 0;
/* nothing to copy */
- if(how_much <= 0)
+ if(show_much <= 0)
goto done;
+ how_much = (size_t)show_much;
/* rewind */
HDfseek(infid, 0L, 0);
@@ -392,8 +394,8 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much )
/* Update positions/size */
how_much -= bytes_read;
- from += bytes_read;
- to += bytes_read;
+ from += (off_t)bytes_read;
+ to += (off_t)bytes_read;
/* Write nchars bytes to output file */
bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid);