Patchwork [3/7] libext2fs: use strcpy()/strcat() instead of sprintf() in bmap functions

login
register
mail settings
Submitter Theodore Ts'o
Date July 30, 2012, 9:47 p.m.
Message ID <1343684862-13181-3-git-send-email-tytso@mit.edu>
Download mbox | patch
Permalink /patch/174106/
State Accepted
Headers show

Comments

Theodore Ts'o - July 30, 2012, 9:47 p.m.
This simplifies the number of C library symbols needed by boot loader
systems such as yaboot.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 lib/ext2fs/gen_bitmap64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/lib/ext2fs/gen_bitmap64.c b/lib/ext2fs/gen_bitmap64.c
index 44b733d..dd2773a 100644
--- a/lib/ext2fs/gen_bitmap64.c
+++ b/lib/ext2fs/gen_bitmap64.c
@@ -322,7 +322,8 @@  errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src,
 			ext2fs_free_mem(&new_bmap);
 			return retval;
 		}
-		sprintf(new_descr, "copy of %s", descr);
+		strcpy(new_descr, "copy of ");
+		strcat(new_descr, descr);
 		new_bmap->description = new_descr;
 	}