diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-09 22:41:07 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-10-09 22:41:07 +0100 |
commit | 247fae6a72dde255ee2a23eb1e3eb1bd7a466ed0 (patch) | |
tree | 45cef121611681b7194702f1420c38eacca81c0f /demo.c | |
parent | 05639c477367fa436ef33a0a4dc5fc37215acd94 (diff) | |
download | termo-247fae6a72dde255ee2a23eb1e3eb1bd7a466ed0.tar.gz termo-247fae6a72dde255ee2a23eb1e3eb1bd7a466ed0.tar.xz termo-247fae6a72dde255ee2a23eb1e3eb1bd7a466ed0.zip |
Gracefully handle constructor failure rather than SEGV
Diffstat (limited to 'demo.c')
-rw-r--r-- | demo.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -6,6 +6,11 @@ int main(int argc, char *argv[]) { char buffer[50]; termkey_t *tk = termkey_new(0, 0); + if(!tk) { + fprintf(stderr, "Cannot allocate termkey instance\n"); + exit(1); + } + termkey_result ret; termkey_key key; |