projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e66d6b3
)
; bindat (strz): Consistent length type check
author
Richard Hansen
<rhansen@rhansen.org>
Sun, 29 May 2022 03:53:51 +0000
(23:53 -0400)
committer
Stefan Monnier
<monnier@iro.umontreal.ca>
Thu, 2 Jun 2022 02:20:49 +0000
(22:20 -0400)
The strz length computation uses `numberp' to switch between
fixed-length and variable-length modes, so packing should too.
lisp/emacs-lisp/bindat.el
patch
|
blob
|
history
diff --git
a/lisp/emacs-lisp/bindat.el
b/lisp/emacs-lisp/bindat.el
index b236e47e5b900d9e851a44dca454fb71a3d1203d..e597dd62479a8a0cd87db8710a7cd3b6af9f4952 100644
(file)
--- a/
lisp/emacs-lisp/bindat.el
+++ b/
lisp/emacs-lisp/bindat.el
@@
-693,7
+693,7
@@
is the name of a variable that will hold the value we need to pack.")
(t `(or ,len (1+ (length ,val)))))))
(`(pack . ,args)
(macroexp-let2 nil len len
- `(if
,len
+ `(if
(numberp ,len)
;; Same as non-zero terminated strings since we don't actually add
;; the terminating zero anyway (because we rely on the fact that
;; `bindat-raw' was presumably initialized with all-zeroes before