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:
@@ -310,7 +310,7 @@ test_executable(const char *name, uid_t user, gid_t group, char *invoker)
|
|||||||
// test for shell scripts
|
// test for shell scripts
|
||||||
if (!strncmp(buffer, "#!", 2)) {
|
if (!strncmp(buffer, "#!", 2)) {
|
||||||
char *end;
|
char *end;
|
||||||
buffer[length - 1] = '\0';
|
buffer[min_c((size_t)length, sizeof(buffer) - 1)] = '\0';
|
||||||
|
|
||||||
end = strchr(buffer, '\n');
|
end = strchr(buffer, '\n');
|
||||||
if (end == NULL) {
|
if (end == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user