From: Wayne Davison Date: Sat, 4 Nov 2006 18:18:58 +0000 (+0000) Subject: Tweaked the increment style of a "for" loop. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/bdeab877d4b86529422ce2aed8168b65a30c71be Tweaked the increment style of a "for" loop. --- diff --git a/xattrs.diff b/xattrs.diff index 6ce2f24..9334471 100644 --- a/xattrs.diff +++ b/xattrs.diff @@ -288,7 +288,7 @@ TODO: } --- old/lib/sysxattr.c +++ new/lib/sysxattr.c -@@ -0,0 +1,136 @@ +@@ -0,0 +1,135 @@ +/* + * Extended attribute support for rsync. + * @@ -403,7 +403,7 @@ TODO: + * terminator. We need to change this into a series of null-terminted + * strings. Since the size is the same, we can simply transform the + * output in place. */ -+ for (off = 0; off < len; ) { ++ for (off = 0; off < len; off += keylen + 1) { + keylen = ((unsigned char*)list)[off]; + if (off + keylen >= len) { + /* Should be impossible, but kernel bugs happen! */ @@ -411,8 +411,7 @@ TODO: + return -1; + } + memmove(list+off, list+off+1, keylen); -+ off += keylen; -+ list[off++] = '\0'; ++ list[off+keylen] = '\0'; + } + + return len;