Commit b32faa5a authored by Taddeüs Kroes's avatar Taddeüs Kroes

- Set everything to 80-char limit.

parent f0b0d329
...@@ -54,9 +54,12 @@ static void gup(FILE * log1, FILE * log2, int pipe_id[2], int myNumber) ...@@ -54,9 +54,12 @@ static void gup(FILE * log1, FILE * log2, int pipe_id[2], int myNumber)
{ {
if( !antidote ) if( !antidote )
{ {
fprintf(log1, "Child %d has no antidote for poison and will exit \n", myNumber); fprintf(log1, "Child %d has no antidote for poison "
fprintf(log2, "Child %d has no antidote for poison and will exit \n", myNumber); "and will exit \n", myNumber);
fprintf(log3, "Child %d has no antidote for poison and will exit \n", myNumber); fprintf(log2, "Child %d has no antidote for poison "
"and will exit \n", myNumber);
fprintf(log3, "Child %d has no antidote for poison "
"and will exit \n", myNumber);
break; break;
} }
else else
...@@ -70,11 +73,11 @@ static void gup(FILE * log1, FILE * log2, int pipe_id[2], int myNumber) ...@@ -70,11 +73,11 @@ static void gup(FILE * log1, FILE * log2, int pipe_id[2], int myNumber)
else if( c == 'A' ) else if( c == 'A' )
{ {
antidote++; antidote++;
fprintf(log1, "Child %d finds antidote (now has %d andidote)\n", fprintf(log1, "Child %d finds antidote (now has %d) \n",
myNumber, antidote); myNumber, antidote);
fprintf(log2, "Child %d finds antidote (now has %d andidote)\n", fprintf(log2, "Child %d finds antidote (now has %d) \n",
myNumber, antidote); myNumber, antidote);
fprintf(log3, "Child %d finds antidote (now has %d andidote)\n", fprintf(log3, "Child %d finds antidote (now has %d) \n",
myNumber, antidote); myNumber, antidote);
} }
} while( c != '\0' ); } while( c != '\0' );
...@@ -126,7 +129,8 @@ main(int argc, char * argv[]) ...@@ -126,7 +129,8 @@ main(int argc, char * argv[])
if( pipe(pipe_id) ) if( pipe(pipe_id) )
{ {
fprintf(stderr, "Error %d occured while creating the pipe \n", errno); fprintf(stderr, "Error %d occured while creating the pipe \n",
errno);
exit(1); exit(1);
} }
...@@ -192,8 +196,10 @@ main(int argc, char * argv[]) ...@@ -192,8 +196,10 @@ main(int argc, char * argv[])
gup(log1, log2, pipe_id, kiddoCount); gup(log1, log2, pipe_id, kiddoCount);
break; break;
default: default:
fprintf(log1, "Started child process %d with id %d \n", kiddoCount, child_id); fprintf(log1, "Started child process %d with id %d \n",
fprintf(log2, "Started child process %d with id %d \n", kiddoCount, child_id); kiddoCount, child_id);
fprintf(log2, "Started child process %d with id %d \n",
kiddoCount, child_id);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment