From 4274405a4c4d908328b98dfda34e9b9a895863c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 7 Jun 2006 20:15:19 +0000 Subject: [PATCH] Even though Ingo broke the build of this tool (and mkbfs as well), this fixes a stupid bug that will generally remove the last byte of any attribute. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17771 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../copy_to_bfs_image/copy_to_bfs_image.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/copy_to_bfs_image/copy_to_bfs_image.cpp b/src/tools/copy_to_bfs_image/copy_to_bfs_image.cpp index 19a3683bbf..4bdbac87e6 100644 --- a/src/tools/copy_to_bfs_image/copy_to_bfs_image.cpp +++ b/src/tools/copy_to_bfs_image/copy_to_bfs_image.cpp @@ -1,17 +1,18 @@ /* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ -#include -#include -#include #include "kprotos.h" #include "argv.h" #include +#include +#include +#include + static status_t copy_file(const char *from, const struct stat &fromStat, const char *to) @@ -46,7 +47,7 @@ copy_file(const char *from, const struct stat &fromStat, const char *to) continue; if (attrInfo.size <= size) - size = attrInfo.size - 1; + size = attrInfo.size ; else printf("truncating attribute: %s\n", attr->d_name); @@ -55,7 +56,6 @@ copy_file(const char *from, const struct stat &fromStat, const char *to) printf("could not read attribute %s: %s\n", attr->d_name, strerror(bytesRead)); continue; } - buffer[size] = '\0'; err = sys_write_attr(1, bfd, attr->d_name, attrInfo.type, buffer, size, 0); if (err < B_OK) {