get_tty_index() did not work correctly, this fixes bug #265 (included the fixed

version, thanks barber).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16624 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-03-07 12:11:04 +00:00
parent 91d4f7a30a
commit 67e33e3e70

View File

@ -652,12 +652,13 @@ get_tty_index(const char *name)
{
// device names follow this form: "pt/%c%x"
int8 digit = name[4];
if (digit >= 'a')
digit -= 'a';
else
if (digit >= 'a') {
// hexadecimal digits
digit -= 'a' - 10;
} else
digit -= '0';
return (name[3] - 'p') * digit;
return (name[3] - 'p') * 16 + digit;
}