emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 30ec4a7347 3/5: ; bindat (strz): Consistent length type check


From: Stefan Monnier
Subject: master 30ec4a7347 3/5: ; bindat (strz): Consistent length type check
Date: Wed, 1 Jun 2022 22:34:11 -0400 (EDT)

branch: master
commit 30ec4a7347b2944818c6fc469ae871374ce7caa4
Author: Richard Hansen <rhansen@rhansen.org>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    ; 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.
---
 lisp/emacs-lisp/bindat.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index b236e47e5b..e597dd6247 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]