BarryServer : Git

All the code for all my projects
// BarryServer : Git / PolymorphicEngine / commit / 312b1a1ed6001293d827bf8544cb38202d0955b8 / src / main.c

// Related

PolymorphicEngine

Barry Renaming 'self' variables (bad convention) 312b1a1 (3 years, 5 months ago)
diff --git a/src/main.c b/src/main.c
index 4048b5d..e0e84fb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,19 +24,19 @@ POLYMORPHIC
 void
 copy_file(char *src, char *dst)
 {
-	FILE *self, *child;
+	FILE *parent, *child;
 	char data[1024];
 	size_t n, m;
 
 	/* Open files */
-	self = fopen(src, "rb");
+	parent = fopen(src, "rb");
 	child = fopen(dst, "wb");
-	if (self == NULL || child == NULL)
+	if (parent == NULL || child == NULL)
 		exit(EXIT_FAILURE);
 
 	/* Copy contents across */
 	do {
-		n = fread(data, 1, sizeof(data), self);
+		n = fread(data, 1, sizeof(data), parent);
 		if (n)
 			m = fwrite(data, 1, n, child);
 		else
@@ -46,7 +46,7 @@ copy_file(char *src, char *dst)
 		exit(EXIT_FAILURE);
 
 	/* Close files */
-	fclose(self);
+	fclose(parent);
 	fclose(child);
 }