mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-12-26 23:20:22 +05:30
main.c: use custom path length limit
This commit is contained in:
parent
0380d97c0f
commit
d69475406b
@ -83,6 +83,8 @@ typedef off_t file_offset_t;
|
|||||||
# define FILE_OFFSET_C(x) ((off_t) x)
|
# define FILE_OFFSET_C(x) ((off_t) x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MAX_PATH_LENGTH_PLUS_1 256
|
||||||
|
|
||||||
/* macros: lambdas */
|
/* macros: lambdas */
|
||||||
#define STRINGIZE(x) #x
|
#define STRINGIZE(x) #x
|
||||||
#define INT2STR(x) STRINGIZE(x)
|
#define INT2STR(x) STRINGIZE(x)
|
||||||
|
@ -106,7 +106,7 @@ static char* my_basename(const char* raw_path) {
|
|||||||
if (path == NULL)
|
if (path == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
char* base = malloc(FILENAME_MAX * sizeof(char));
|
char* base = malloc(MAX_PATH_LENGTH_PLUS_1 * sizeof(char));
|
||||||
|
|
||||||
if (base == NULL) {
|
if (base == NULL) {
|
||||||
free(path);
|
free(path);
|
||||||
|
Loading…
Reference in New Issue
Block a user