Skip to content

Commit

Permalink
Add missing linefeeds in stderr logging
Browse files Browse the repository at this point in the history
Lacking linefeed chars cause messages to get concatenated.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
  • Loading branch information
spiiroin authored and Tomin1 committed Feb 19, 2021
1 parent a6d1315 commit 7f98dbf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/firejail/fs_mkdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void mkdir_recursive(char *path) {
struct stat s;

if (chdir("/")) {
fprintf(stderr, "Error: can't chdir to /");
fprintf(stderr, "Error: can't chdir to /\n");
return;
}

Expand All @@ -63,7 +63,7 @@ static void mkdir_recursive(char *path) {
return;
}
if (chdir(subdir)) {
fprintf(stderr, "Error: can't chdir to %s", subdir);
fprintf(stderr, "Error: can't chdir to %s\n", subdir);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/firejail/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static void check_network(Bridge *br) {
else if (br->ipsandbox) { // for macvlan check network range
char *rv = in_netrange(br->ipsandbox, br->ip, br->mask);
if (rv) {
fprintf(stderr, "%s", rv);
fprintf(stderr, "%s\n", rv);
exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/firejail/network_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void net_configure_sandbox_ip(Bridge *br) {
// check network range
char *rv = in_netrange(br->ipsandbox, br->ip, br->mask);
if (rv) {
fprintf(stderr, "%s", rv);
fprintf(stderr, "%s\n", rv);
exit(1);
}
// send an ARP request and check if there is anybody on this IP address
Expand Down

0 comments on commit 7f98dbf

Please sign in to comment.