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:
parent
8d9e496670
commit
a29e765ec0
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue