summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@raeburn.org>2009-11-14 14:53:46 -0500
committerKen Raeburn <raeburn@raeburn.org>2009-11-16 01:10:15 -0500
commitb9fd657add26c7936fdfda80fc382630181cb113 (patch)
tree084e9964a44c1e6458d1f3d3d4812ca3869b17ed
parentb10d93309b4c96caa5d399716c9b09a862c8ce0e (diff)
downloadguile-b9fd657add26c7936fdfda80fc382630181cb113.tar.gz
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.
-rw-r--r--libguile/read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libguile/read.c b/libguile/read.c
index e403cc302..775612a58 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -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]);