Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 6ffbb26

Browse files
committed
Removed MCStringGetCString from deploy_linux.cpp / deploy_sign.cpp / deploy_windows.cpp
1 parent 76aa07b commit 6ffbb26

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

engine/src/deploy_linux.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,11 @@ Exec_stat MCDeployToELF(const MCDeployParameters& p_params, bool p_is_android)
876876
// If on Mac OS X or Linux, make the file executable
877877
#if defined(_MACOSX) || defined(_LINUX)
878878
if (t_success)
879-
chmod(MCStringGetCString(t_path), 0755);
879+
{
880+
MCAutoStringRefAsUTF8String t_utf8_path;
881+
/* UNCHECKED */ t_utf8_path . Lock(t_path);
882+
chmod(*t_utf8_path, 0755);
883+
}
880884
#endif
881885

882886
return t_success ? ES_NORMAL : ES_ERROR;

engine/src/deploy_sign.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,9 @@ bool MCDeploySignWindows(const MCDeploySignParameters& p_params)
10461046
t_output = nil;
10471047
if (t_success)
10481048
{
1049-
t_output = BIO_new_file(MCStringGetCString(p_params . output), "wb");
1049+
MCAutoStringRefAsUTF8String t_params_output_utf8;
1050+
/* UNCHECKED */ t_params_output_utf8 . Lock(p_params . output);
1051+
t_output = BIO_new_file(*t_params_output_utf8, "wb");
10501052
if (t_output == nil)
10511053
t_success = MCDeployThrow(kMCDeployErrorNoOutput);
10521054
}

engine/src/deploy_windows.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,9 @@ static void MCWindowsVersionInfoDestroy(MCWindowsVersionInfo *self)
10751075
static uint64_t MCWindowsVersionInfoParseVersion(MCStringRef p_string)
10761076
{
10771077
uint32_t a, b, c, d;
1078-
if (sscanf(MCStringGetCString(p_string), "%u.%u.%u.%u", &a, &b, &c, &d) != 4)
1078+
MCAutoStringRefAsUTF8String t_string_utf8;
1079+
/* UNCHECKED */ t_string_utf8 . Lock(p_string);
1080+
if (sscanf(*t_string_utf8, "%u.%u.%u.%u", &a, &b, &c, &d) != 4)
10791081
return 0;
10801082
return 0ULL | ((uint64_t)a << 48) | ((uint64_t)b << 32) | (c << 16) | d;
10811083
}
@@ -1100,7 +1102,7 @@ static bool add_version_info_entry(void *p_context, MCArrayRef p_array, MCNameRe
11001102
t_bytes[t_byte_count - 2] = '\0';
11011103
t_bytes[t_byte_count - 1] = '\0';
11021104
}
1103-
return MCWindowsVersionInfoAdd((MCWindowsVersionInfo *)p_context, MCStringGetCString(MCNameGetString(p_key)), true, t_bytes, t_byte_count, t_string);
1105+
return MCWindowsVersionInfoAdd((MCWindowsVersionInfo *)p_context, MCNameGetCString(p_key), true, t_bytes, t_byte_count, t_string);
11041106
}
11051107

11061108
static bool MCWindowsResourcesAddVersionInfo(MCWindowsResources& self, MCArrayRef p_info)

0 commit comments

Comments
 (0)