branch: elpa/emacsql
commit f54142f1eb1cd5bceb8130cf9bfafbfa8dd3d74b
Author: Christopher Wellons <well...@nullprogram.com>
Commit: Christopher Wellons <well...@nullprogram.com>

    Argument list checking in emacsql-format.
---
 emacsql.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/emacsql.el b/emacsql.el
index e2c646d578..728b0a8f42 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -329,6 +329,8 @@ See also `emacsql-with-errors'."
 (defun emacsql-format (expansion &rest args)
   "Fill in the variables EXPANSION with ARGS."
   (cl-destructuring-bind (format . vars) expansion
+    (unless (= (length args) (length vars))
+      (error "Wrong number of arguments for SQL template."))
     (apply #'format format
            (cl-loop for (i . kind) in vars collect
                     (let ((thing (nth i args)))

Reply via email to