[Ocfs2-commits] zab commits r2003 - branches/usysfsify/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Mar 17 20:12:06 CST 2005


Author: zab
Date: 2005-03-17 20:12:05 -0600 (Thu, 17 Mar 2005)
New Revision: 2003

Modified:
   branches/usysfsify/fs/ocfs2/super.c
Log:
o My name is zach.  I understand snprintf().


Modified: branches/usysfsify/fs/ocfs2/super.c
===================================================================
--- branches/usysfsify/fs/ocfs2/super.c	2005-03-18 01:43:40 UTC (rev 2002)
+++ branches/usysfsify/fs/ocfs2/super.c	2005-03-18 02:12:05 UTC (rev 2003)
@@ -1047,10 +1047,12 @@
 	memcpy(osb->uuid, uuid, MAX_VOL_ID_LENGTH);
 
 	for (i = 0, ptr = osb->uuid_str; i < MAX_VOL_ID_LENGTH; i++) {
-		ret = snprintf(ptr, 2, "%02X", uuid[i]);
+		/* print with null */
+		ret = snprintf(ptr, 3, "%02X", uuid[i]);
 		if (ret != 2) /* drop super cleans up */
 			return -EINVAL;
-		ptr += ret;
+		/* then only advace past the last char */
+		ptr += 2;
 	}
 
 	return 0;



More information about the Ocfs2-commits mailing list