summaryrefslogtreecommitdiff
path: root/udevdb.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-03-09 19:50:15 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:08 -0700
commit17794d77b97fcb8af263bcecbe03dad5d0e9a89a (patch)
treefc87f4d731a6543aaae346875768ff57fc85413a /udevdb.c
parent3f20eac0a58dc3987200773a39163e30b60993fc (diff)
[PATCH] rename strn*() macros to strmax
Hey, I wrote the strn*() macros just 10 days ago and yesterday this trap caught me with the %c{x} bug. The names are misleading cause we all expect that the from field is limited by the size argument, but we actually limit the overall size of the destination string to prevent a overflow. Here we rename all strn*() macros to str*max(). That should be more self-explanatory.
Diffstat (limited to 'udevdb.c')
-rw-r--r--udevdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/udevdb.c b/udevdb.c
index b12f5b3d46..01df3ba7e1 100644
--- a/udevdb.c
+++ b/udevdb.c
@@ -184,7 +184,7 @@ static int find_device_by_name(char *path, struct udevice *dev)
if (strncmp(dev->name, find_name, sizeof(dev->name)) == 0) {
memcpy(find_dev, dev, sizeof(struct udevice));
- strnfieldcpy(find_path, path, NAME_SIZE);
+ strfieldcpymax(find_path, path, NAME_SIZE);
find_found = 1;
/* stop search */
return 1;
@@ -198,7 +198,7 @@ static int find_device_by_name(char *path, struct udevice *dev)
continue;
memcpy(find_dev, dev, sizeof(struct udevice));
- strnfieldcpy(find_path, path, NAME_SIZE);
+ strfieldcpymax(find_path, path, NAME_SIZE);
find_found = 1;
return 1;
}