diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:30 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:30 +0200 |
commit | e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3 (patch) | |
tree | c4e410dd878ceed9fc058d14bad8011b423212fe /FunctionBar.c | |
parent | eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95 (diff) | |
download | debian_htop-e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3.tar.gz debian_htop-e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3.tar.bz2 debian_htop-e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3.zip |
Imported Upstream version 1.0.1upstream/1.0.1
Diffstat (limited to 'FunctionBar.c')
-rw-r--r-- | FunctionBar.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/FunctionBar.c b/FunctionBar.c index ef0fcba..dc4368e 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -5,19 +5,18 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "Object.h" #include "FunctionBar.h" + #include "CRT.h" -#include "debug.h" #include <assert.h> - #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <curses.h> /*{ +#include "Object.h" typedef struct FunctionBar_ { Object super; @@ -54,8 +53,8 @@ FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* eve this->events = malloc(sizeof(int) * 15); int i = 0; while (i < 15 && functions[i]) { - this->functions[i] = String_copy(functions[i]); - this->keys[i] = String_copy(keys[i]); + this->functions[i] = strdup(functions[i]); + this->keys[i] = strdup(keys[i]); this->events[i] = events[i]; i++; } @@ -89,7 +88,7 @@ void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) { for (int i = 0; i < this->size; i++) { if (this->events[i] == event) { free(this->functions[i]); - this->functions[i] = String_copy(text); + this->functions[i] = strdup(text); break; } } |