File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -409,8 +409,8 @@ clean() {
409
409
CLEAN=" y"
410
410
fi
411
411
if [[ ${CLEAN} =~ [Yy] ]]; then
412
- rm -fr " ${LOCALOUT} " /*
413
- rm -fr " ${LOCALBIN} " /*
412
+ rm -fr " ${LOCALOUT:? } " /*
413
+ rm -fr " ${LOCALBIN:? } " /*
414
414
if ${LOG} ; then
415
415
echo -e " ${GREEN} ✓${CLEAR} Cleaned ${CYAN}${LOCALOUT} /*${CLEAR} & ${CYAN}${LOCALBIN} /*${CLEAR} successfully."
416
416
fi
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ void *convert_string_to_wide(const char *str) {
36
36
#endif
37
37
38
38
int write_file (const char * filename , const char * content ) {
39
- FILE * file = fopen (filename , "wb " );
39
+ FILE * file = fopen (filename , "w " );
40
40
if (!file ) {
41
41
perror ("Failed to open file" );
42
42
fclose (file );
@@ -53,7 +53,7 @@ int write_file(const char *filename, const char *content) {
53
53
}
54
54
55
55
char * read_file (const char * file_path ) {
56
- FILE * file = fopen (file_path , "rb " );
56
+ FILE * file = fopen (file_path , "r " );
57
57
size_t file_len = 0 ;
58
58
59
59
if (!file ) {
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ char **get_environment_variables() {
87
87
while (* ptr != '\0' && count < 4096 - 1 ) {
88
88
size_t len = strlen (ptr );
89
89
env_array [count ] = malloc (len + 1 );
90
- strcpy (env_array [count ], ptr );
90
+ strlcpy (env_array [count ], ptr , strlen ( env_array [ count ]) + 1 );
91
91
ptr += len + 1 ;
92
92
count ++ ;
93
93
}
You can’t perform that action at this time.
0 commit comments