Fix off-by-one error in processing Emacs-style coding declaration.
authorKen Raeburn <raeburn@raeburn.org>
Sat, 14 Nov 2009 19:53:46 +0000 (14:53 -0500)
committerKen Raeburn <raeburn@raeburn.org>
Mon, 16 Nov 2009 06:10:15 +0000 (01:10 -0500)
* libguile/read.c (scm_i_scan_for_encoding): Don't copy the first
  character after the coding declaration into the new string.

libguile/read.c

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