diff options
author | zml <zml@FreeBSD.org> | 2010-05-12 21:25:05 +0000 |
---|---|---|
committer | zml <zml@FreeBSD.org> | 2010-05-12 21:25:05 +0000 |
commit | 5510a8aa0e8e5659604be43d56e464bc7910ca66 (patch) | |
tree | 2a2c930a19a5db201c60f6b7140b06d1fe0dccf1 | |
parent | 773cda6040b0b1d6fe89422c1946947d521fd2eb (diff) | |
download | FreeBSD-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
-rw-r--r-- | usr.sbin/extattr/rmextattr.c | 7 |
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: |