diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-02-28 01:59:02 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:34:28 -0700 |
commit | c58e36c092ad5acc84d35e455ecc74096b25ae66 (patch) | |
tree | 6030871e62499303759ecf4660fc26d9b3683004 /udev-add.c | |
parent | 7eb136adb8fe265050b2a3e44b216e747163743f (diff) |
[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.
Diffstat (limited to 'udev-add.c')
-rw-r--r-- | udev-add.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |