summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorzml <zml@FreeBSD.org>2010-05-12 21:25:05 +0000
committerzml <zml@FreeBSD.org>2010-05-12 21:25:05 +0000
commit5510a8aa0e8e5659604be43d56e464bc7910ca66 (patch)
tree2a2c930a19a5db201c60f6b7140b06d1fe0dccf1 /usr.sbin
parent773cda6040b0b1d6fe89422c1946947d521fd2eb (diff)
downloadFreeBSD-src-5510a8aa0e8e5659604be43d56e464bc7910ca66.zip
FreeBSD-src-5510a8aa0e8e5659604be43d56e464bc7910ca66.tar.gz
extattr: Fix a signed/unsigned issue
Submitted by: Matthew Fleming <matthew.fleming@isilon.com> Reviewed by: zml, dfr
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/extattr/rmextattr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/extattr/rmextattr.c b/usr.sbin/extattr/rmextattr.c
index 7ed92b6..db7df1a 100644
--- a/usr.sbin/extattr/rmextattr.c
+++ b/usr.sbin/extattr/rmextattr.c
@@ -231,9 +231,12 @@ main(int argc, char *argv[])
break;
if (!flag_quiet)
printf("%s\t", argv[arg_counter]);
- for (i = 0; i < error; i += buf[i] + 1)
+ for (i = 0; i < error; i += ch + 1) {
+ /* The attribute name length is unsigned. */
+ ch = (unsigned char)buf[i];
printf("%s%*.*s", i ? "\t" : "",
- buf[i], buf[i], buf + i + 1);
+ ch, ch, buf + i + 1);
+ }
printf("\n");
continue;
case EAGET:
OpenPOWER on IntegriCloud