1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

Fix off-by-one error in processing Emacs-style coding declaration.

* libguile/read.c (scm_i_scan_for_encoding): Don't copy the first
  character after the coding declaration into the new string.
This commit is contained in:
Ken Raeburn 2009-11-14 14:53:46 -05:00
parent b10d93309b
commit b9fd657add

View file

@ -1513,7 +1513,7 @@ scm_i_scan_for_encoding (SCM port)
if (i == 0) if (i == 0)
return NULL; return NULL;
encoding = scm_gc_strndup (pos, i + 1, "encoding"); encoding = scm_gc_strndup (pos, i, "encoding");
for (i = 0; i < strlen (encoding); i++) for (i = 0; i < strlen (encoding); i++)
encoding[i] = toupper ((int) encoding[i]); encoding[i] = toupper ((int) encoding[i]);