diff options
author | Richard Hansen <rhansen@rhansen.org> | 2022-05-28 23:10:44 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-06-01 22:18:24 -0400 |
commit | e66d6b379345063900eb3e99db6367c69a860cdf (patch) | |
tree | 9faf504d4cb0297209cedb94bd49e46c1e0b4d99 /test/lisp/emacs-lisp | |
parent | 916492cb6d531e3ae16f1dc361725d60074af844 (diff) | |
download | emacs-e66d6b379345063900eb3e99db6367c69a860cdf.tar.gz emacs-e66d6b379345063900eb3e99db6367c69a860cdf.tar.bz2 emacs-e66d6b379345063900eb3e99db6367c69a860cdf.zip |
bindat (strz): Fix off-by-one bug in computed length
* lisp/emacs-lisp/bindat.el (strz): Include null terminator when
computing packed string length.
* test/lisp/emacs-lisp/bindat-tests.el (strz): Mark tests as passing.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/bindat-tests.el | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/bindat-tests.el b/test/lisp/emacs-lisp/bindat-tests.el index c8545a216be..cb7b6fe1c20 100644 --- a/test/lisp/emacs-lisp/bindat-tests.el +++ b/test/lisp/emacs-lisp/bindat-tests.el @@ -191,12 +191,10 @@ (let ((spec (bindat-type strz))) (ert-deftest bindat-test--strz-varlen-len () - :expected-result :failed (should (equal (bindat-length spec "") 1)) (should (equal (bindat-length spec "abc") 4))) (ert-deftest bindat-test--strz-varlen-pack () - :expected-result :failed (should (equal (bindat-pack spec "") "\0")) (should (equal (bindat-pack spec "abc") "abc\0"))) |