aboutsummaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorgotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2007-07-11 20:34:58 +0000
committergotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2007-07-11 20:34:58 +0000
commit6f1e53123f1aaec7f41ec7bc8ccffc499692ae76 (patch)
tree9b19260cec3ebc7cf8be55b28596fb927b21ef49 /action.c
parentbdd290f1ae860943492c4fe5bad598eca75ae94c (diff)
downloaddzen-6f1e53123f1aaec7f41ec7bc8ccffc499692ae76.tar.gz
dzen-6f1e53123f1aaec7f41ec7bc8ccffc499692ae76.zip
corrected stupid error in add_handler()
git-svn-id: http://dzen.googlecode.com/svn/trunk@122 f2baff5b-bf2c-0410-a398-912abdc3d8b2
Diffstat (limited to 'action.c')
-rw-r--r--action.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/action.c b/action.c
index 78285e6..74a71a5 100644
--- a/action.c
+++ b/action.c
@@ -93,9 +93,10 @@ add_handler(long evid, int hpos, handlerf* hcb) {
item = head;
while(item) {
if(item->id == evid) {
- item->action[hpos] = emalloc(sizeof(As));
- item->action[hpos]->handler = hcb;
- item->action[hpos+1]->handler = NULL;
+ if(hpos < MAXACTIONS) {
+ item->action[hpos] = emalloc(sizeof(As));
+ item->action[hpos]->handler = hcb;
+ }
break;
}
item = item->next;
@@ -109,8 +110,10 @@ add_option(long evid, int hpos, int opos, char* opt) {
item = head;
while(item) {
if(item->id == evid) {
- item->action[hpos]->options[opos] = estrdup(opt);
- item->action[hpos]->options[opos+1] = NULL;
+ if(opos < MAXOPTIONS) {
+ item->action[hpos]->options[opos] = estrdup(opt);
+ item->action[hpos]->options[opos+1] = NULL;
+ }
break;
}
item = item->next;