Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
michael@0 | 1 | #include <stdio.h> |
michael@0 | 2 | #include "prenv.h" |
michael@0 | 3 | |
michael@0 | 4 | int main(int argc, char* argv[]) |
michael@0 | 5 | { |
michael@0 | 6 | if (argc != 2) |
michael@0 | 7 | return 1; |
michael@0 | 8 | |
michael@0 | 9 | const char* value = PR_GetEnv("WRITE_ARGUMENT_FILE"); |
michael@0 | 10 | |
michael@0 | 11 | if (!value) |
michael@0 | 12 | return 2; |
michael@0 | 13 | |
michael@0 | 14 | FILE* outfile = fopen(value, "w"); |
michael@0 | 15 | if (!outfile) |
michael@0 | 16 | return 3; |
michael@0 | 17 | |
michael@0 | 18 | // We only need to write out the first argument (no newline). |
michael@0 | 19 | fputs(argv[argc -1], outfile); |
michael@0 | 20 | |
michael@0 | 21 | fclose(outfile); |
michael@0 | 22 | |
michael@0 | 23 | return 0; |
michael@0 | 24 | } |