aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-29 16:13:38 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-29 16:13:38 +0000
commitee12c698da34cb707899e666f7a57cc4bf241623 (patch)
treeb7af31737523f7eaeb7ad46d7c8601d4b68ad9bc /termkey.c
parent9b20346dc36e52b8ddefd8b92628440557d57195 (diff)
downloadtermo-ee12c698da34cb707899e666f7a57cc4bf241623.tar.gz
termo-ee12c698da34cb707899e666f7a57cc4bf241623.tar.xz
termo-ee12c698da34cb707899e666f7a57cc4bf241623.zip
Document the errors set by termkey_new(), use errno rather than fprintf() to stderr
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/termkey.c b/termkey.c
index 6df53bd..e3daa3e 100644
--- a/termkey.c
+++ b/termkey.c
@@ -266,7 +266,7 @@ static int termkey_init(TermKey *tk, const char *term)
}
if(!tk->drivers) {
- fprintf(stderr, "Unable to find a terminal driver\n");
+ errno = ENOENT;
goto abort_free_keynames;
}
@@ -1114,7 +1114,7 @@ static TermKeySym register_c0(TermKey *tk, TermKeySym sym, unsigned char ctrl, c
static TermKeySym register_c0_full(TermKey *tk, TermKeySym sym, int modifier_set, int modifier_mask, unsigned char ctrl, const char *name)
{
if(ctrl >= 0x20) {
- fprintf(stderr, "Cannot register C0 key at ctrl 0x%02x - out of bounds\n", ctrl);
+ errno = EINVAL;
return -1;
}