summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-02-28 01:59:02 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:34:28 -0700
commitc58e36c092ad5acc84d35e455ecc74096b25ae66 (patch)
tree6030871e62499303759ecf4660fc26d9b3683004 /namedev.c
parent7eb136adb8fe265050b2a3e44b216e747163743f (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 'namedev.c')
-rw-r--r--namedev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/namedev.c b/namedev.c
index 7c07e3b104..581a7f2218 100644
--- a/namedev.c
+++ b/namedev.c
@@ -263,11 +263,11 @@ static void apply_format(struct udevice *udev, char *string, size_t maxsize,
dbg("substitute kernel number '%s'", udev->kernel_number);
break;
case 'm':
- sprintf(pos, "%u", udev->minor);
+ strnintcat(string, udev->minor, maxsize);
dbg("substitute minor number '%u'", udev->minor);
break;
- case 'M':
- sprintf(pos, "%u", udev->major);
+ case 'M':
+ strnintcat(string, udev->major, maxsize);
dbg("substitute major number '%u'", udev->major);
break;
case 'c':