|
@@ -1,6 +1,7 @@
|
|
#include <libmegapixels.h>
|
|
#include <libmegapixels.h>
|
|
#include <unistd.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
|
|
+#include <limits.h>
|
|
#include "flash.h"
|
|
#include "flash.h"
|
|
#include "util.h"
|
|
#include "util.h"
|
|
|
|
|
|
@@ -18,12 +19,12 @@ libmegapixels_flash_cleanup_flash_path(libmegapixels_camera *camera)
|
|
char *
|
|
char *
|
|
libmegapixels_flash_get_led_path(const char *path)
|
|
libmegapixels_flash_get_led_path(const char *path)
|
|
{
|
|
{
|
|
- char *result = malloc(275);
|
|
|
|
|
|
+ char *result = malloc(PATH_MAX);
|
|
if (result == NULL) {
|
|
if (result == NULL) {
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
- snprintf(result, 275, "%s/flash_strobe", path);
|
|
|
|
|
|
+ snprintf(result, PATH_MAX, "%s/flash_strobe", path);
|
|
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|