15 lines
396 B
C
15 lines
396 B
C
#include "include/challenges.h"
|
|
|
|
char genChallenge(int fd, char * output, challenge_t challenge) {
|
|
printf("%s\n", challenge.message);
|
|
|
|
int readChars;
|
|
readChars = read(fd, output, MAX_LEN - 1);
|
|
if (readChars < 0)
|
|
printSystemError("Challenges: read()");
|
|
output[readChars] = '\0';
|
|
|
|
printf("%s\n", challenge.question);
|
|
|
|
return strcmp(output, challenge.flag);
|
|
} |