Date: Wed, 12 May 2010 21:25:05 +0000 (UTC) From: Zachary Loafman <zml@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208004 - head/usr.sbin/extattr Message-ID: <201005122125.o4CLP5OM028018@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: zml Date: Wed May 12 21:25:05 2010 New Revision: 208004 URL: http://svn.freebsd.org/changeset/base/208004 Log: extattr: Fix a signed/unsigned issue Submitted by: Matthew Fleming <matthew.fleming@isilon.com> Reviewed by: zml, dfr Modified: head/usr.sbin/extattr/rmextattr.c Modified: head/usr.sbin/extattr/rmextattr.c ============================================================================== --- head/usr.sbin/extattr/rmextattr.c Wed May 12 21:24:46 2010 (r208003) +++ head/usr.sbin/extattr/rmextattr.c Wed May 12 21:25:05 2010 (r208004) @@ -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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005122125.o4CLP5OM028018>