From 3ff7e6803cb06e43a79bff8afe6fba710ee2874c Mon Sep 17 00:00:00 2001 From: Duc Nguyen Date: Thu, 5 Jan 2023 14:36:20 +0700 Subject: [PATCH] fixed overflow error --- client.c | 2 +- jobs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client.c b/client.c index 4ba8497..8fd26b8 100755 --- a/client.c +++ b/client.c @@ -797,7 +797,7 @@ void c_show_cmd() { if (res != m.u.size) error("Error in show_cmd - line size"); - printf("%s", string); + printf("%s\n", string); free(string); return; default: diff --git a/jobs.c b/jobs.c index f679c3d..bd219a6 100755 --- a/jobs.c +++ b/jobs.c @@ -303,12 +303,12 @@ void s_send_cmd(int s, int jobid) { if (p == 0) { char tmp[50]; - sprintf(tmp, "Job %i not finished or not running.\n", jobid); + sprintf(tmp, "Job %i not found in the queue.\n", jobid); send_list_line(s, tmp); return; } cmd = (char *) malloc(strlen(p->command) + 1); - sprintf(cmd, "%s\n", p->command); + sprintf(cmd, "%s", p->command); send_list_line(s, cmd); free(cmd); }