diff options
author | Renato Botelho <renato@netgate.com> | 2016-02-22 08:15:16 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-02-22 08:15:16 -0300 |
commit | f4f04f91a787d9f61d56b19a966ae4a9b9e79ad5 (patch) | |
tree | c8f562ba883b266c55aa072076176e4a77d56cea /sys/boot/i386/gptboot/gptboot.c | |
parent | 0122703298a46bed8c81d6430ffe126414556b51 (diff) | |
parent | 4112d41bd632ff2eb376f20f94cfed638b0426bf (diff) | |
download | FreeBSD-src-f4f04f91a787d9f61d56b19a966ae4a9b9e79ad5.zip FreeBSD-src-f4f04f91a787d9f61d56b19a966ae4a9b9e79ad5.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/boot/i386/gptboot/gptboot.c')
-rw-r--r-- | sys/boot/i386/gptboot/gptboot.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index 5316706..a1f46eb 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -132,6 +132,7 @@ int main(void) { char cmd[512], cmdtmp[512]; + ssize_t sz; int autoboot, dskupdated; ufs_ino_t ino; @@ -160,9 +161,10 @@ main(void) for (;;) { *kname = '\0'; if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); - + (ino = lookup(PATH_DOTCONFIG))) { + sz = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[(sz < 0) ? 0 : sz] = '\0'; + } if (*cmd != '\0') { memcpy(cmdtmp, cmd, sizeof(cmdtmp)); if (parse(cmdtmp, &dskupdated)) |