chiark / gitweb /
[PATCH] add a test for a minor over 255
[elogind.git] / udevdb.c
index b12f5b3d46e5538b948cf8799f7269090293f9fa..01df3ba7e12ac084918f54f67746e0f08948ef91 100644 (file)
--- 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;
        }