dev: remove strcln in favor of strdup

This commit is contained in:
2025-06-11 16:13:01 +02:00
parent aa1cafe743
commit cbb3aa3910
4 changed files with 3 additions and 8 deletions

View File

@@ -174,7 +174,8 @@ bool launch(char* user, char* passwd, struct session session, void (*cb)(void),
if (pid == 0) { // child
char* term = NULL;
char* getterm = getenv("TERM");
if (getterm != NULL) strcln(&term, getterm);
// TODO: handle malloc error
if (getterm != NULL) term = strdup(getterm);
if (clearenv() != 0) {
print_errno("clearenv");
_exit(EXIT_FAILURE);