=== modified file 'driver-ti.c' --- driver-ti.c 2008-11-12 16:10:58 +0000 +++ driver-ti.c 2008-11-09 22:38:10 +0000 @@ -24,7 +24,7 @@ } termkey_ti; static int funcname2keysym(const char *funcname, termkey_type *typep, termkey_keysym *symp, int *modmask, int *modsetp); -static int register_seq(termkey_ti *ti, const char *seq, termkey_type type, termkey_keysym sym, int modmask, int modset); +static void register_seq(termkey_ti *ti, const char *seq, termkey_type type, termkey_keysym sym, int modmask, int modset); static void *new_driver(termkey_t *tk, const char *term) { @@ -66,15 +66,11 @@ continue; if(sym != TERMKEY_SYM_NONE) - if(!register_seq(ti, value, type, sym, mask, set)) - goto abort_free_seqs; + register_seq(ti, value, type, sym, mask, set); } return ti; -abort_free_seqs: - free(ti->seqs); - abort_free_ti: free(ti); @@ -244,13 +240,12 @@ return 0; } -static int register_seq(termkey_ti *ti, const char *seq, termkey_type type, termkey_keysym sym, int modmask, int modset) +static void register_seq(termkey_ti *ti, const char *seq, termkey_type type, termkey_keysym sym, int modmask, int modset) { if(ti->nseqs == ti->alloced_seqs) { ti->alloced_seqs *= 2; void *newseqs = realloc(ti->seqs, ti->alloced_seqs * sizeof(ti->seqs[9])); - if(!newseqs) - return 0; + // TODO: Handle realloc() failure ti->seqs = newseqs; } @@ -261,8 +256,6 @@ ti->seqs[i].key.sym = sym; ti->seqs[i].key.modifier_mask = modmask; ti->seqs[i].key.modifier_set = modset; - - return 1; } struct termkey_driver termkey_driver_ti = {