...but I seem to have made a small mistake. Line 186 ought actually to read: for (i = strlen(keybuffer) - 1; i >= 0; i--) { with the - 1 and not the - 2. Sorry! --Greg