summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/blueshift_drm_c.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c
index 19b8e19..ce37f43 100644
--- a/src/blueshift_drm_c.c
+++ b/src/blueshift_drm_c.c
@@ -20,16 +20,11 @@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <limits.h>
#include <alloca.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
-#ifndef PATH_MAX
- #define PATH_MAX 4096
-#endif
-
/* Requires video group */
@@ -40,8 +35,8 @@
*/
long blueshift_drm_card_count()
{
- char* pathname = alloca(PATH_MAX * sizeof(char));
long len = strlen("/dev/dri/card");
+ char* pathname = alloca((len + 21) * sizeof(char));
long count = 0;
struct stat attr;