| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: getextattr.c,v 1.5 2011/06/27 16:34:48 manu Exp $ */ | | 1 | /* $NetBSD: getextattr.c,v 1.6 2011/06/28 07:24:14 manu Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. | | 4 | * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. |
5 | * Copyright (c) 2002 Poul-Henning Kamp. | | 5 | * Copyright (c) 2002 Poul-Henning Kamp. |
6 | * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson | | 6 | * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * This software was developed for the FreeBSD Project by Poul-Henning | | 9 | * This software was developed for the FreeBSD Project by Poul-Henning |
10 | * Kamp and Network Associates Laboratories, the Security Research Division | | 10 | * Kamp and Network Associates Laboratories, the Security Research Division |
11 | * of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 | | 11 | * of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 |
12 | * ("CBOSS"), as part of the DARPA CHATS research program | | 12 | * ("CBOSS"), as part of the DARPA CHATS research program |
13 | * | | 13 | * |
14 | * Redistribution and use in source and binary forms, with or without | | 14 | * Redistribution and use in source and binary forms, with or without |
| @@ -227,28 +227,28 @@ main(int argc, char *argv[]) | | | @@ -227,28 +227,28 @@ main(int argc, char *argv[]) |
227 | if (error < 0) | | 227 | if (error < 0) |
228 | break; | | 228 | break; |
229 | mkbuf(&buf, &buflen, error); | | 229 | mkbuf(&buf, &buflen, error); |
230 | if (flag_nofollow) | | 230 | if (flag_nofollow) |
231 | error = extattr_list_link(argv[arg_counter], | | 231 | error = extattr_list_link(argv[arg_counter], |
232 | attrnamespace, buf, buflen); | | 232 | attrnamespace, buf, buflen); |
233 | else | | 233 | else |
234 | error = extattr_list_file(argv[arg_counter], | | 234 | error = extattr_list_file(argv[arg_counter], |
235 | attrnamespace, buf, buflen); | | 235 | attrnamespace, buf, buflen); |
236 | if (error < 0) | | 236 | if (error < 0) |
237 | break; | | 237 | break; |
238 | if (!flag_quiet) | | 238 | if (!flag_quiet) |
239 | printf("%s\t", argv[arg_counter]); | | 239 | printf("%s\t", argv[arg_counter]); |
240 | for (i = 0; i < error; i += buf[i] + 1) | | 240 | for (i = 0; i < error; i += strlen(buf + i) + 1) |
241 | printf("%s%s", i ? "\t" : "", buf + i + 1); | | 241 | printf("%s%s", i ? "\t" : "", buf + i); |
242 | printf("\n"); | | 242 | printf("\n"); |
243 | continue; | | 243 | continue; |
244 | case EAGET: | | 244 | case EAGET: |
245 | if (flag_nofollow) | | 245 | if (flag_nofollow) |
246 | error = extattr_get_link(argv[arg_counter], | | 246 | error = extattr_get_link(argv[arg_counter], |
247 | attrnamespace, attrname, NULL, 0); | | 247 | attrnamespace, attrname, NULL, 0); |
248 | else | | 248 | else |
249 | error = extattr_get_file(argv[arg_counter], | | 249 | error = extattr_get_file(argv[arg_counter], |
250 | attrnamespace, attrname, NULL, 0); | | 250 | attrnamespace, attrname, NULL, 0); |
251 | if (error < 0) | | 251 | if (error < 0) |
252 | break; | | 252 | break; |
253 | mkbuf(&buf, &buflen, error); | | 253 | mkbuf(&buf, &buflen, error); |
254 | if (flag_nofollow) | | 254 | if (flag_nofollow) |