Fix indentation

This commit is contained in:
Marek Kraus 2022-12-06 16:10:46 +01:00
parent b9a2baae13
commit a68c54ed2b

View File

@ -35,17 +35,17 @@ static void* cmd_write_argtable[6];
#include <stdlib.h>
static void get_executable_path(char* buffer_out, uint32_t max_size) {
assert (max_size >= PATH_MAX); // n.b. 1024 on MacOS. 4K on most Linux.
assert (max_size >= PATH_MAX); // n.b. 1024 on MacOS. 4K on most Linux.
char raw_path_name[PATH_MAX]; // $HOME/../../var/tmp/x
char real_path_name[PATH_MAX]; // /var/tmp/x
uint32_t raw_path_size = sizeof(raw_path_name);
char raw_path_name[PATH_MAX]; // $HOME/../../var/tmp/x
char real_path_name[PATH_MAX]; // /var/tmp/x
uint32_t raw_path_size = sizeof(raw_path_name);
if(!_NSGetExecutablePath(raw_path_name, &raw_path_size)) {
realpath(raw_path_name, real_path_name);
}
// *real_path_name is appropriately sized and null terminated.
strcpy(buffer_out, real_path_name);
if(!_NSGetExecutablePath(raw_path_name, &raw_path_size)) {
realpath(raw_path_name, real_path_name);
}
// *real_path_name is appropriately sized and null terminated.
strcpy(buffer_out, real_path_name);
}
#endif
@ -57,8 +57,8 @@ get_binary_folder(char* buffer, uint32_t buffer_size) {
}
char* pos = strrchr(buffer, '/');
#elif defined(__APPLE__)
get_executable_path(buffer, buffer_size);
char* pos = strrchr(buffer, '/');
get_executable_path(buffer, buffer_size);
char* pos = strrchr(buffer, '/');
#else
if (GetModuleFileName(NULL, buffer, buffer_size) <= 0) {
return -1;