Skip to content

Commit b3a4db9

Browse files
committed
fix super super weird Windows 10 + plain CMD issue #179
I promise I would never write C code again.
1 parent 130f54e commit b3a4db9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/calm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ const char *get_lib_env() {
159159
if (ori_lib_env == NULL) {
160160
ori_lib_env = "";
161161
}
162-
char *lib_env = malloc(
163-
(strlen(ori_lib_env) + strlen(lib_path) + strlen(path_separator) + 1) *
164-
sizeof(char));
162+
char *lib_env =
163+
malloc((strlen(ori_lib_env) + strlen(lib_path) + strlen(path_separator) +
164+
1024 // I don't know what I'm doing
165+
) *
166+
sizeof(char));
165167
strcpy(lib_env, ori_lib_env);
166168

167169
#if defined _WIN32

0 commit comments

Comments
 (0)