From 3ccb3b6b51e39b364f34cf7a1f3ed913c07fef68 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 11 Apr 2014 22:30:05 +0200 Subject: use limits.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blueshift_drm_c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/blueshift_drm_c.c') diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c index a900685..8da5ccf 100644 --- a/src/blueshift_drm_c.c +++ b/src/blueshift_drm_c.c @@ -76,13 +76,13 @@ void blueshift_drm_close(void) */ int blueshift_drm_card_count(void) { - char pathname[4096]; + char pathname[PATH_MAX]; int count = 0; struct stat _attr; for (;;) { - snprintf(pathname, 4096, DRM_DEV_NAME, DRM_DIR_NAME, count); + snprintf(pathname, PATH_MAX, DRM_DEV_NAME, DRM_DIR_NAME, count); if (stat(pathname, &_attr)) break; count++; @@ -100,11 +100,11 @@ int blueshift_drm_card_count(void) */ int blueshift_drm_open_card(int card_index) { - char pathname[4096]; + char pathname[PATH_MAX]; int fd; int rc; - snprintf(pathname, 4096, DRM_DEV_NAME, DRM_DIR_NAME, card_index); + snprintf(pathname, PATH_MAX, DRM_DEV_NAME, DRM_DIR_NAME, card_index); fd = open(pathname, O_RDWR | O_CLOEXEC); if (fd < 0) -- cgit v1.2.3-70-g09d2