diff --git a/spiceypy/spiceypy.py b/spiceypy/spiceypy.py index 080e5396..3074515a 100644 --- a/spiceypy/spiceypy.py +++ b/spiceypy/spiceypy.py @@ -1896,7 +1896,7 @@ def dafgda(handle, begin, end): :rtype: Array of floats """ handle = ctypes.c_int(handle) - data = stypes.emptyDoubleVector(abs(end - begin)) + data = stypes.emptyDoubleVector(abs(end - begin) + 1) begin = ctypes.c_int(begin) end = ctypes.c_int(end) libspice.dafgda_c(handle, begin, end, data) diff --git a/spiceypy/tests/test_wrapper.py b/spiceypy/tests/test_wrapper.py index 2fb19ac6..689df1c1 100644 --- a/spiceypy/tests/test_wrapper.py +++ b/spiceypy/tests/test_wrapper.py @@ -1007,7 +1007,7 @@ def test_dafgda(): # not a very good test... spice.kclear() handle = spice.dafopr(CoreKernels.spk) - elements = spice.dafgda(handle, 20, 21) + elements = spice.dafgda(handle, 20, 20) assert elements == [0.0] spice.dafcls(handle) spice.kclear()