Don't overwrite the last read byte with the null-terminator. Fixes bug

#1536.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22452 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-10-05 19:01:18 +00:00
parent 570263197e
commit 7ca40195ba
+1 -1
View File
@@ -310,7 +310,7 @@ test_executable(const char *name, uid_t user, gid_t group, char *invoker)
// test for shell scripts
if (!strncmp(buffer, "#!", 2)) {
char *end;
buffer[length - 1] = '\0';
buffer[min_c((size_t)length, sizeof(buffer) - 1)] = '\0';
end = strchr(buffer, '\n');
if (end == NULL) {