sna: Fix the last character before a colon in the fake-edid paths

I chopped off one too many characters when creating the path in the
presence of a colon-delimited list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-07-22 11:34:51 +01:00
parent 8d9e496670
commit a29e765ec0
1 changed files with 4 additions and 4 deletions

View File

@ -4333,14 +4333,14 @@ static char *fake_edid_name(xf86OutputPtr output)
if (colon)
len = colon - str;
else
len = strlen(str) + 1;
len = strlen(str);
path = malloc(len);
path = malloc(len + 1);
if (path == NULL)
return NULL;
memcpy(path, str, len - 1);
path[len-1] = '\0';
memcpy(path, str, len);
path[len] = '\0';
return path;
}