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.flem...@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:
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to