Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions util/grub-mklayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,16 @@ write_keymaps (FILE *in, FILE *out, const char *out_filename)
char shift[64];
char normalalt[64];
char shiftalt[64];

sscanf (line, "keycode %u = %60s %60s %60s %60s", &keycode_linux,
normal, shift, normalalt, shiftalt);

if (sscanf (line, "keycode %u = %60s %60s %60s %60s", &keycode_linux,
normal, shift, normalalt, shiftalt) != 5) {
/* Bail out since keycodes could not be read, this can happen
* when the in FILE is coming from stdin and user fails to specify the keycode in
* proper format
*/
fprintf (stderr, "%s", _("ERROR: no valid keyboard layout found. Check the input.\n"));
exit (1);
}

if (keycode_linux >= ARRAY_SIZE (linux_to_usb_map))
{
Expand Down