Re: [PATCH v4l-utils v7 4/7] mediactl: Add media_device creation helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/24/2016 03:32 PM, Sakari Ailus wrote:
[...]
+	sprintf(device_dir_path, "/sys/class/video4linux/%s/device/", p + 1);
+
+	device_dir = opendir(device_dir_path);
+	if (device_dir == NULL)
+		return NULL;
+
+	while ((entry = readdir(device_dir))) {
+		if (strncmp(entry->d_name, "media", 4))

Why 4? And isn't entry->d_name nul-terminated, so you could use strcmp()?

Media devices, as other devices, have numerical postfix, which is
not of our interest.

Right. But still 5 would be the right number as we should also check the
last "a".

Of course, this needs to be fixed, thanks.

--
Best regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux