summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-03-13 07:34:13 +0000
committerRoland McGrath <roland@gnu.org>2000-03-13 07:34:13 +0000
commitbc0b9cba288f065f3f0cf93448f680fe813d267b (patch)
tree3a6bd6f8f1ec52c16a6f302fab46cd252a492115 /exec
parentba58c0ae52705837efb7610d2226a1cee1693a7c (diff)
2000-03-13 Roland McGrath <roland@baalperazim.frob.com>
* hashexec.c (check_hashbang): Fix fencepost error in last change.
Diffstat (limited to 'exec')
-rw-r--r--exec/hashexec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/exec/hashexec.c b/exec/hashexec.c
index 96677088..35f1b458 100644
--- a/exec/hashexec.c
+++ b/exec/hashexec.c
@@ -149,13 +149,13 @@ check_hashbang (struct execdata *e,
if (p == NULL)
{
/* The first line went on for more than sizeof INTERP_BUF! */
- interp_len = sizeof interp_buf - 1;
+ interp_len = sizeof interp_buf;
interp_buf[interp_len] = '\0';
}
else
{
+ interp_len = p - interp_buf; /* Includes null terminator. */
*--p = '\0'; /* Kill the newline. */
- interp_len = p - interp_buf;
}
/* We are now done reading the script file. */