diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-03-09 19:50:15 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:35:08 -0700 |
commit | 17794d77b97fcb8af263bcecbe03dad5d0e9a89a (patch) | |
tree | fc87f4d731a6543aaae346875768ff57fc85413a /udevdb.c | |
parent | 3f20eac0a58dc3987200773a39163e30b60993fc (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |