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
This commit is contained in:
Axel Dörfler 2006-06-07 20:15:19 +00:00
parent 6a32527a14
commit 4274405a4c

View File

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kprotos.h"
#include "argv.h"
#include <fs_attr.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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) {