diff options
author | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2007-07-11 20:34:58 +0000 |
---|---|---|
committer | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2007-07-11 20:34:58 +0000 |
commit | 6f1e53123f1aaec7f41ec7bc8ccffc499692ae76 (patch) | |
tree | 9b19260cec3ebc7cf8be55b28596fb927b21ef49 /action.c | |
parent | bdd290f1ae860943492c4fe5bad598eca75ae94c (diff) | |
download | dzen-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.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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; |