From: Richard Hansen Date: Sun, 29 May 2022 03:53:51 +0000 (-0400) Subject: ; bindat (strz): Consistent length type check X-Git-Tag: emacs-29.0.90~1910^2~297 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=30ec4a7347b2944818c6fc469ae871374ce7caa4;p=emacs.git ; bindat (strz): Consistent length type check The strz length computation uses `numberp' to switch between fixed-length and variable-length modes, so packing should too. --- diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index b236e47e5b9..e597dd62479 100644 --- 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