Skip to content

Commit

Permalink
fixed overflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Jan 5, 2023
1 parent 8c3d69c commit 3ff7e68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3ff7e68

Please sign in to comment.