Skip to content

Commit

Permalink
Re: github issues
Browse files Browse the repository at this point in the history
#917
#915

Fix following memory errors:
1. global_buffer_overflow
2. nc4_att_list_add
  • Loading branch information
DennisHeimbigner committed Mar 29, 2018
1 parent 595b1ab commit d7ad871
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions hdf4_test/run_get_hdf4_files.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

#Q=-q

# This shell gets some sample HDF4 files from the netCDF ftp site for
# testing. Then it runs program tst_interops3 on the test file to
# check that HDF4 reading works.
Expand All @@ -9,6 +11,20 @@
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

# Get a file from the ftp site; retry several times
getfile() {
FTPFILE="ftp://ftp.unidata.ucar.edu/pub/netcdf/sample_data/hdf4/$1.gz"
for try in 1 2 3 ; do # try 3 times
# signal sucess/failure
if wget -c $Q --passive-ftp $FTPFILE ; then
return 0 # got it
fi
echo "wget failed: try $try"
sleep 5 # seconds
done
return 1 # did not get it
}

set -e
echo ""
echo "Getting HDF4 sample files from Unidata FTP site..."
Expand All @@ -21,8 +37,12 @@ echo "Getting HDF4 test files $file_list"
for f1 in $file_list
do
if ! test -f $f1; then
wget "ftp://ftp.unidata.ucar.edu/pub/netcdf/sample_data/hdf4/$f1.gz"
gunzip $f1.gz
if getfile $f1 ; then
gunzip $f1.gz
else
echo Could not ftp $f1.gz
return 1
fi
fi
done

Expand Down

0 comments on commit d7ad871

Please sign in to comment.