urandom.c
changeset 20 5fec678f931b
parent 9 c3fecc82ade6
child 27 81a574d60c15
--- a/urandom.c
+++ b/urandom.c
@@ -1,5 +1,5 @@
 /**
- * test/demos/tree.c
+ * test/demos/urandom.c
  * Copyright (C) 2008 Markus Broeker
  */
 
@@ -28,6 +28,7 @@
 
     elements = read (fd, numbers, 255);
     numbers[elements] = 0;
+    close (fd);
 
     qsort (numbers, elements, sizeof (unsigned char), (void *)&compare);
 
@@ -35,7 +36,5 @@
         printf ("Number: %d\n", numbers[i]);
     }
 
-    close (fd);
-
     return EXIT_SUCCESS;
 }