aboutsummaryrefslogtreecommitdiff
path: root/src/lib/fnct_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/fnct_key.c')
-rw-r--r--src/lib/fnct_key.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/fnct_key.c b/src/lib/fnct_key.c
index bac0fdb5..69498ec0 100644
--- a/src/lib/fnct_key.c
+++ b/src/lib/fnct_key.c
@@ -1,7 +1,7 @@
/*
Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
All rights reserved.
- Copyright (C) Gabriel Dos Reis.
+ Copyright (C) 2007-2011 Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -65,7 +65,7 @@ using namespace OpenAxiom;
fkey function_key[13]; /** Strings which replace function
keys when a key is hit ***/
-static char *defaulteditor = "clefedit";
+static const char *defaulteditor = "clefedit";
char editorfilename[100];
@@ -153,11 +153,8 @@ define_function_keys(void)
}
break;
}
- if (type != -1) {
- (function_key[key]).str =
- (char *) malloc(strlen(string) + 1);
- sprintf((function_key[key]).str, "%s", string);
- }
+ if (type != -1)
+ (function_key[key]).str = strdup(string);
}
}