Add a missing error message which causes an invalid layout name to crash.

This commit is contained in:
nicm 2023-02-02 09:24:59 +00:00
parent 993e7a937f
commit f10854cfc5

View File

@ -162,8 +162,10 @@ layout_parse(struct window *w, const char *layout, char **cause)
u_short csum; u_short csum;
/* Check validity. */ /* Check validity. */
if (sscanf(layout, "%hx,", &csum) != 1) if (sscanf(layout, "%hx,", &csum) != 1) {
*cause = xstrdup("invalid layout");
return (-1); return (-1);
}
layout += 5; layout += 5;
if (csum != layout_checksum(layout)) { if (csum != layout_checksum(layout)) {
*cause = xstrdup("invalid layout"); *cause = xstrdup("invalid layout");