diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2010-03-26 23:03:13 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2010-03-26 23:03:13 +0000 |
commit | 22b0d7df64cdfae8bab6ba8df07a16afd5dbed75 (patch) | |
tree | d33e5c5bf6b37acb3a8d2b3627d52fea45987d5e | |
parent | b4a63409f54b9c324d1baf0f153fe615a21502aa (diff) |
oops
(Thanks to Bert Wesarg for the heads up)
-rw-r--r-- | FunctionBar.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/FunctionBar.c b/FunctionBar.c index 5bd90c1e..ee65333d 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -52,12 +52,14 @@ FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* eve this->functions = malloc(sizeof(char*) * 15); this->keys = malloc(sizeof(char*) * 15); this->events = malloc(sizeof(int) * 15); - for (int i = 0; i < 15 && functions[i]; i++) { + int i = 0; + while (i < 15 && functions[i]) { this->functions[i] = String_copy(functions[i]); this->keys[i] = String_copy(keys[i]); this->events[i] = events[i]; - this->size = i; + i++; } + this->size = i; } else { this->staticData = true; this->functions = (char**)( functions ? functions : FunctionBar_FLabels ); |