Check for the right return value from sscanf.

pull/1/head
Nicholas Marriott 2012-02-05 22:23:13 +00:00
parent fe7cf0ba90
commit 3f49137f90
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ layout_construct(struct layout_cell *lcparent, const char **layout)
if (!isdigit((u_char) **layout))
return (NULL);
if (sscanf(*layout, "%ux%u,%u,%u,%*u", &sx, &sy, &xoff, &yoff) != 5 &&
if (sscanf(*layout, "%ux%u,%u,%u,%*u", &sx, &sy, &xoff, &yoff) != 4 &&
sscanf(*layout, "%ux%u,%u,%u", &sx, &sy, &xoff, &yoff) != 4)
return (NULL);