From c58e36c092ad5acc84d35e455ecc74096b25ae66 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Sat, 28 Feb 2004 01:59:02 -0800 Subject: [PATCH] udev - safer sprintf() use Here is for now my last patch to the string handling for a rather theorethical case, where the node is very very very long. :) We have accordant to strfieldcat(to, from) now a strintcat(to, i) macro, which appends the ascii representation of a integer to a string in a safe way. --- udev-add.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'udev-add.c') diff --git a/udev-add.c b/udev-add.c index 8fdd66fad5..3a72c544b8 100644 --- a/udev-add.c +++ b/udev-add.c @@ -211,7 +211,8 @@ static int create_node(struct udevice *dev, int fake) info("creating device partition nodes '%s[1-%i]'", filename, dev->partitions); if (!fake) { for (i = 1; i <= dev->partitions; i++) { - sprintf(partitionname, "%s%i", filename, i); + strfieldcpy(partitionname, filename); + strintcat(partitionname, i); make_node(partitionname, dev->major, dev->minor + i, dev->mode, uid, gid); } -- cgit v1.2.3-54-g00ecf