Module Name: src Committed By: manu Date: Sun Jun 17 08:09:29 UTC 2012
Modified Files: src/usr.bin/extattr: getextattr.c Log Message: Fix off-by-one in hexdump display (getextattr -x), which displayed a trailing garbage byte. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.bin/extattr/getextattr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/extattr/getextattr.c diff -u src/usr.bin/extattr/getextattr.c:1.9 src/usr.bin/extattr/getextattr.c:1.10 --- src/usr.bin/extattr/getextattr.c:1.9 Fri Sep 16 15:39:25 2011 +++ src/usr.bin/extattr/getextattr.c Sun Jun 17 08:09:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: getextattr.c,v 1.9 2011/09/16 15:39:25 joerg Exp $ */ +/* $NetBSD: getextattr.c,v 1.10 2012/06/17 08:09:29 manu Exp $ */ /*- * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. @@ -143,14 +143,14 @@ hexdump(const char *addr, size_t len) for (i = 0; i < len; i += 16) { printf(" %03x ", i); for (j = 0; j < 16; j++) { - if (i + j > len) + if (i + j >= len) printf(" "); else printf("%02x ", addr[i + j] & 0xff); } printf(" "); for (j = 0; j < 16; j++) { - if (i + j > len) + if (i + j >= len) printf(" "); else printf("%c", HEXDUMP_PRINT(addr[i + j]));