Sync OpenBSD patchset 572:

Make types clearer and lint happier.
This commit is contained in:
Tiago Cunha 2009-11-28 14:57:04 +00:00
parent 4c7b3a5906
commit 575510045a

View File

@ -1,4 +1,4 @@
/* $Id: key-string.c,v 1.26 2009-11-10 23:30:26 tcunha Exp $ */ /* $Id: key-string.c,v 1.27 2009-11-28 14:57:04 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -105,12 +105,12 @@ int
key_string_lookup_string(const char *string) key_string_lookup_string(const char *string)
{ {
int key; int key;
const u_char *ptr; const char *ptr;
if (string[0] == '\0') if (string[0] == '\0')
return (KEYC_NONE); return (KEYC_NONE);
if (string[1] == '\0') if (string[1] == '\0')
return (string[0]); return ((u_char) string[0]);
ptr = NULL; ptr = NULL;
if ((string[0] == 'C' || string[0] == 'c') && string[1] == '-') if ((string[0] == 'C' || string[0] == 'c') && string[1] == '-')
@ -133,7 +133,7 @@ key_string_lookup_string(const char *string)
} else { } else {
if (ptr[1] != '\0') if (ptr[1] != '\0')
return (KEYC_NONE); return (KEYC_NONE);
key = ptr[0]; key = (u_char) ptr[0];
} }
/* /*
@ -162,7 +162,7 @@ key_string_lookup_string(const char *string)
} else { } else {
if (ptr[1] == '\0') if (ptr[1] == '\0')
return (KEYC_NONE); return (KEYC_NONE);
key = ptr[0]; key = (u_char) ptr[0];
} }
if (key >= 32 && key <= 127) if (key >= 32 && key <= 127)
@ -209,7 +209,7 @@ key_string_lookup_key(int key)
} }
if (key >= 32 && key <= 255) { if (key >= 32 && key <= 255) {
tmp[0] = key; tmp[0] = (char) key;
tmp[1] = '\0'; tmp[1] = '\0';
return (tmp); return (tmp);
} }