Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static bool spawn_process(struct pss_tty *pss, uint16_t columns, uint16_t rows)
char *filePath = xmalloc(file_path_len);
snprintf(filePath, file_path_len, "%sXXXXXX", server->arg_file);

if ((fd = mkstemp(filePath)) != -1) {
if ((fd = mkstemp(filePath)) == -1) {
lwsl_err("Creation of temp file failed with error: %d (%s)\n", errno, strerror(errno));
return false;
}
Expand All @@ -124,7 +124,7 @@ static bool spawn_process(struct pss_tty *pss, uint16_t columns, uint16_t rows)

if (close(fd) != 0) {
lwsl_err("Close temp file failed with error: %d (%s)\n", errno, strerror(errno));
return false
return false;
}
argv[n++] = filePath;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ static void wsi_output(struct lws *wsi, pty_buf_t *buf) {
int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in,
size_t len) {
struct pss_tty *pss = (struct pss_tty *)user;
char buf[256];
char buf[1024];
size_t n = 0;

switch (reason) {
Expand Down