Add CMD_BUF_LEN

This commit is contained in:
realaltffour 2020-04-28 16:23:04 +03:00
parent 04d6718932
commit 19e378d4e4
No known key found for this signature in database
GPG Key ID: 7115CD2AC9A76A56
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)
project("fixmydownloads" VERSION 1.2.0 LANGUAGES C)
project("fixmydownloads" VERSION 1.2.2 LANGUAGES C)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})

View File

@ -11,6 +11,7 @@
#define EVENT_SIZE (sizeof(struct inotify_event))
#define EVENT_BUF_LEN (1024 * (EVENT_SIZE + 16))
#define PATH_BUF_LEN 4096
#define CMD_BUF_LEN ((PATH_BUF_LEN * 2) * 1.2)
static const int IGNORE_LIST_SIZE = 1;
static const char *extension_ignore_list[] = { "crdownload" };
@ -104,7 +105,7 @@ void move(const char *name)
}
/* Ensure/Create directories for organization */
char *cmd = (char *)malloc(8096 * 2.5 * sizeof(char));
char *cmd = (char *)malloc(CMD_BUF_LEN * sizeof(char));
strcat(cmd, "mkdir --parents \"");
strcat(cmd, pad_unique_chars(org));
strcat(cmd, "\"\0");