Skip to content

Commit

Permalink
Merge pull request #53 from codecrafters-io/CC-1248
Browse files Browse the repository at this point in the history
CC-1248: Disable output buffering for both stdout and stderr
  • Loading branch information
ryan-gang authored May 30, 2024
2 parents 37bdefb + 10d1608 commit 37e5414
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions compiled_starters/c/app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
int main(int argc, char *argv[]) {
// Disable output buffering
setbuf(stdout, NULL);
setbuf(stderr, NULL);

// You can use print statements as follows for debugging, they'll be visible when running tests.
printf("Logs from your program will appear here!\n");
Expand Down
1 change: 1 addition & 0 deletions solutions/c/01-je9/code/app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
int main(int argc, char *argv[]) {
// Disable output buffering
setbuf(stdout, NULL);
setbuf(stderr, NULL);

char *command = argv[3];
int child_pid = fork();
Expand Down
3 changes: 2 additions & 1 deletion solutions/c/01-je9/diff/app/main.c.diff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@@ -1,32 +1,27 @@
@@ -1,33 +1,28 @@
#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
Expand All @@ -7,6 +7,7 @@
int main(int argc, char *argv[]) {
// Disable output buffering
setbuf(stdout, NULL);
setbuf(stderr, NULL);

- // You can use print statements as follows for debugging, they'll be visible when running tests.
- printf("Logs from your program will appear here!\n");
Expand Down
1 change: 1 addition & 0 deletions starter_templates/c/app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
int main(int argc, char *argv[]) {
// Disable output buffering
setbuf(stdout, NULL);
setbuf(stderr, NULL);

// You can use print statements as follows for debugging, they'll be visible when running tests.
printf("Logs from your program will appear here!\n");
Expand Down

0 comments on commit 37e5414

Please sign in to comment.