summaryrefslogtreecommitdiff
path: root/number.c
diff options
context:
space:
mode:
Diffstat (limited to 'number.c')
-rw-r--r--number.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/number.c b/number.c
index d1dfe3a..6bd11c6 100644
--- a/number.c
+++ b/number.c
@@ -91,7 +91,7 @@ get_unique_window_number ()
/* look for a unique number, and add it to the list of taken
numbers. */
i = 0;
- while (add_to_list (i)) i++;
+ while (!add_to_list (i)) i++;
return i;
}
@@ -112,3 +112,19 @@ return_window_number (int n)
}
}
}
+
+
+void
+init_numbers ()
+{
+ max_taken = 10;
+ num_taken = 0;
+
+ numbers_taken = malloc (max_taken * sizeof (int));
+ if (numbers_taken == NULL)
+ {
+ fprintf (stderr, "numbers.c: Cannot alloc numbers_taken.\n");
+ exit (EXIT_FAILURE);
+ }
+
+}