From 22d47d5e2bba29b360cd9202e1a81f49009fdc84 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 4 May 2009 01:18:11 +0000 Subject: [PATCH] * emacs-lisp/bindat.el (bindat-pack): Allocate and set a string directly (Bug#2878). --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bindat.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 71bb2fc569..923ef10e32 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-05-04 Miles Bader + + * emacs-lisp/bindat.el (bindat-pack): Allocate and set a string + directly (Bug#2878). + 2009-05-03 Juanma Barranquero * term/ns-win.el (ns-alternatives-map, ns-insert-working-text) diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index 4843e279d1..154bffe618 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -609,9 +609,9 @@ Optional fourth arg BINDAT-IDX is the starting offset into BINDAT-RAW." (let ((no-return bindat-raw)) (unless bindat-idx (setq bindat-idx 0)) (unless bindat-raw - (setq bindat-raw (make-vector (+ bindat-idx (bindat-length spec struct)) 0))) + (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec struct)) 0))) (bindat--pack-group struct spec) - (if no-return nil (concat bindat-raw)))) + (if no-return nil bindat-raw))) ;; Misc. format conversions -- 2.20.1