Commit Diff


commit - fd7369d0b842fe22cd668ff41d6c4eed3ea548a0
commit + fdc4e5ea5a5c79384231dc931bf6e53499fa23e2
blob - 38e805d47cdc9eeb4bfd6a7c9acbf6074b47bbb7
blob + 2727b9249b35510da80a072f48006fc5848db0f9
--- examples/test.c
+++ examples/test.c
@@ -22,11 +22,25 @@ inline static void *sys_brk (void *ptr)
 }
 
 int main (int argc, char *argv[]) {
-	int *ptr;
+	FILE *in, *out;
+	int ch, *ptr;
 
 	ptr = malloc (4);
 	*ptr = 1;
 	free (ptr);
 
+	in = fopen ("/test.txt", "r");
+	if (in == NULL)
+		err (1, "open('test.txt')");
+
+	out = fopen ("/output.txt", "w");
+	if (out == NULL)
+		err (1, "open('output.txt')");
+
+	while ((ch = fgetc (in)) != EOF)
+		fputc (ch, out);
+
+	fclose (out);
+	fclose (in);
 	return 0;
 }