File: second.c

package info (click to toggle)
crossfire-client 1.71.0-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,712 kB
  • ctags: 2,260
  • sloc: ansic: 21,465; sh: 4,159; makefile: 259; perl: 72; python: 69
file content (19 lines) | stat: -rw-r--r-- 383 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdbool.h>
#include <stdio.h>

#define LENGTH 200

int main() {
    char buffer[LENGTH];

    // Ask the client for a copy of all commands sent to the server.
    fprintf(stdout, "monitor\n");
    fflush(stdout);

    // Read the commands and print to standard error.
    while (fgets(buffer, LENGTH, stdin) != NULL) {
        fputs(buffer, stderr);
    }

    return 0;
}