diff options
-rw-r--r-- | drmaa/v1/low.scm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drmaa/v1/low.scm b/drmaa/v1/low.scm index 97e9a67..52d37f3 100644 --- a/drmaa/v1/low.scm +++ b/drmaa/v1/low.scm @@ -85,15 +85,15 @@ STRING-LIST." (let* ((n (length string-list)) (pointers (map string->pointer string-list)) (addresses (map pointer-address pointers)) - (bv (make-bytevector (* (1+ n) (sizeof '*)))) + ;; Make it one item longer, because it needs to be a + ;; NULL-terminated array. + (bv (make-bytevector (* (1+ n) (sizeof '*)) 0)) (bv-set! (case (sizeof '*) ((4) bytevector-u32-native-set!) ((8) bytevector-u64-native-set!)))) (for-each (lambda (address index) (bv-set! bv (* (sizeof '*) index) address)) addresses (iota n)) - ;; The vector must be NULL-terminated - (bv-set! bv (* (1+ n) (sizeof '*)) 0) bv)) (define-syntax-rule (return ret success error-message) |