Skip to content

Commit

Permalink
fixed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Oct 5, 2021
1 parent 8e09425 commit e04d4f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void run_child(int fd_send_filename) {
if (command_line.stderr_apart) {
int errfd;
strncpy(errfname, outfname_full, sizeof errfname);
strncat(errfname, ".e", 2);
strncat(errfname, ".e", 2 + 1);
errfd = open(errfname, O_CREAT | O_WRONLY | O_TRUNC, 0600);
assert(err == 0);
err = dup2(errfd, 2);
Expand All @@ -202,7 +202,7 @@ static void run_child(int fd_send_filename) {
if (command_line.stderr_apart) {
int errfd;
strncpy(errfname, outfname_full, sizeof errfname);
strncat(errfname, ".e", 2);
strncat(errfname, ".e", 2 + 1);
errfd = open(errfname, O_CREAT | O_WRONLY | O_TRUNC, 0600);
dup2(errfd, 2);
close(errfd);
Expand Down
2 changes: 1 addition & 1 deletion list.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static char *shorten(char *line, int len) {
else {
char *newline = (char *) malloc((len + 1) * sizeof(char));
snprintf(newline, len - 4, "%s", line);
sprintf(newline, "%s...", newline);
strcat(newline, "...");
return newline;
}
}
Expand Down

0 comments on commit e04d4f4

Please sign in to comment.