[Ocfs2-tools-commits] zab commits r305 - in trunk: fsck.ocfs2 mkfs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Sep 30 19:35:24 CDT 2004


Author: zab
Date: 2004-09-30 19:35:22 -0500 (Thu, 30 Sep 2004)
New Revision: 305

Modified:
   trunk/fsck.ocfs2/pass2.c
   trunk/mkfs.ocfs2/readdir.c
Log:
o DOO DEE DOO.  's/%*s/%.*s/' to really limit string output


Modified: trunk/fsck.ocfs2/pass2.c
===================================================================
--- trunk/fsck.ocfs2/pass2.c	2004-10-01 00:24:08 UTC (rev 304)
+++ trunk/fsck.ocfs2/pass2.c	2004-10-01 00:35:22 UTC (rev 305)
@@ -80,7 +80,7 @@
 	       	if (!dirent_has_dots(dirent, 1) && !dirent_has_dots(dirent, 2))
 			return 0;
 		if (should_fix(ost, FIX_DEFYES, 
-			       "Duplicate '%*s' directory found, remove?",
+			       "Duplicate '%.*s' directory found, remove?",
 			       dirent->name_len, dirent->name)) {
 			/* XXX I don't understand the inode = 0 clearing */
 			dirent->inode = 0;
@@ -202,7 +202,7 @@
 	for(; len-- && (*chr == '/' || *chr == '\0'); chr++) {
 		/* XXX in %s parent name */
 		if (!fix) {
-			fix = should_fix(ost, FIX_DEFYES, "Entry '%*s' "
+			fix = should_fix(ost, FIX_DEFYES, "Entry '%.*s' "
 					"contains invalid characters, replace "
 					"with dots?", dirent->name_len, 
 					dirent->name);
@@ -276,7 +276,7 @@
 	/* XXX do we care to have expected 0 -> lead to "set" rather than
 	 * "fix" language? */
 	if ((dirent->file_type != expected_type) &&
-	    should_fix(ost, FIX_DEFYES, "entry %*s contains file type %s (%u) "
+	    should_fix(ost, FIX_DEFYES, "entry %.*s contains file type %s (%u) "
 		"but its inode %"PRIu64" leads to type %s (%u)",
 		dirent->name_len, dirent->name, 
 		file_type_string(dirent->file_type), dirent->file_type,
@@ -324,8 +324,8 @@
 	}
 
 	if (should_fix(ost, 0, "directory inode %"PRIu64" is not the first to "
-		"claim to be the parent of subdir '%*s' (%"PRIu64").  Forget "
-		"this linkage and leave the previous parent of '%*s' intact?",
+		"claim to be the parent of subdir '%.*s' (%"PRIu64").  Forget "
+		"this linkage and leave the previous parent of '%.*s' intact?",
 		dbe->e_ino, dirent->name_len, dirent->name, dirent->inode,
 		dirent->name_len, dirent->name)) {
 
@@ -357,7 +357,7 @@
 	if (!was_set)
 		return 0;
 
-	fprintf(stderr, "Duplicate directory entry '%*s' found.\n",
+	fprintf(stderr, "Duplicate directory entry '%.*s' found.\n",
 		      dirent->name_len, dirent->name);
 	fprintf(stderr, "Marking its parent %"PRIu64" for rebuilding.\n",
 			dbe->e_ino);
@@ -408,7 +408,7 @@
 		/* I wonder if we should be checking that the padding
 		 * is 0 */
 
-		printf("dir entry %u %*s\n", dirent->rec_len, dirent->name_len,
+		printf("dir entry %u %.*s\n", dirent->rec_len, dirent->name_len,
 						dirent->name);
 
 		this_flags = fix_dirent_lengths(dd->ost, dbe, dirent, offset, 

Modified: trunk/mkfs.ocfs2/readdir.c
===================================================================
--- trunk/mkfs.ocfs2/readdir.c	2004-10-01 00:24:08 UTC (rev 304)
+++ trunk/mkfs.ocfs2/readdir.c	2004-10-01 00:35:22 UTC (rev 305)
@@ -133,11 +133,11 @@
 
 		de = (struct ocfs2_dir_entry *)p;
 		if (de->rec_len==0 || de->inode==0 || de->name_len==0) {
-			printf("BAD OR END: inode=%llu, rec_len=%d, name_len=%d, file_type=%d, name='%*s'\n",
+			printf("BAD OR END: inode=%llu, rec_len=%d, name_len=%d, file_type=%d, name='%.*s'\n",
 				de->inode, de->rec_len, de->name_len, de->file_type, de->name_len, de->name);
 			break;
 		}
-		printf("entry #%d: inode=%llu, rec_len=%d, name_len=%d, file_type=%hhu, name='%*s'\n",
+		printf("entry #%d: inode=%llu, rec_len=%d, name_len=%d, file_type=%hhu, name='%.*s'\n",
 		       ++entry, de->inode, de->rec_len, de->name_len, de->file_type, de->name_len,
 		       de->name);
 		p += de->rec_len;



More information about the Ocfs2-tools-commits mailing list