Skip to content

Commit

Permalink
Don't pass user-defined strings to printf().
Browse files Browse the repository at this point in the history
This allows % to be safely used in lisp symbol names which pass
through the groveler, such as the following:

(cvar ("errno" %errno) :int)
  • Loading branch information
jre authored and luismbo committed Jan 6, 2013
1 parent 6f74f5e commit c8d9c20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grovel/grovel.lisp
Expand Up @@ -89,7 +89,7 @@ int main(int argc, char**argv) {

(defun c-format (out fmt &rest args)
(let ((text (unescape-for-c (format nil "~?" fmt args))))
(format out "~& fprintf(output, \"~A\");~%" text)))
(format out "~& fputs(\"~A\", output);~%" text)))

(defun c-printf (out fmt &rest args)
(flet ((item (item)
Expand Down

0 comments on commit c8d9c20

Please sign in to comment.