mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-12-26 07:09:50 +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)
|
||||
#endif
|
||||
|
||||
#define MAX_PATH_LENGTH_PLUS_1 256
|
||||
|
||||
/* macros: lambdas */
|
||||
#define STRINGIZE(x) #x
|
||||
#define INT2STR(x) STRINGIZE(x)
|
||||
|
@ -106,7 +106,7 @@ static char* my_basename(const char* raw_path) {
|
||||
if (path == NULL)
|
||||
return NULL;
|
||||
|
||||
char* base = malloc(FILENAME_MAX * sizeof(char));
|
||||
char* base = malloc(MAX_PATH_LENGTH_PLUS_1 * sizeof(char));
|
||||
|
||||
if (base == NULL) {
|
||||
free(path);
|
||||
|
Loading…
Reference in New Issue
Block a user