kdrive: Get rid of xstrdup when argument is definitely non-NULL
ditto for Kdrive Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
parent
1615836695
commit
dd45b7d746
|
@ -919,7 +919,7 @@ KdAddConfigKeyboard (char *keyboard)
|
||||||
if (!new)
|
if (!new)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
new->line = xstrdup(keyboard);
|
new->line = strdup(keyboard);
|
||||||
new->next = NULL;
|
new->next = NULL;
|
||||||
|
|
||||||
for (prev = &kdConfigKeyboards; *prev; prev = &(*prev)->next);
|
for (prev = &kdConfigKeyboards; *prev; prev = &(*prev)->next);
|
||||||
|
@ -987,7 +987,7 @@ KdAddConfigPointer (char *pointer)
|
||||||
if (!new)
|
if (!new)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
new->line = xstrdup(pointer);
|
new->line = strdup(pointer);
|
||||||
new->next = NULL;
|
new->next = NULL;
|
||||||
|
|
||||||
for (prev = &kdConfigPointers; *prev; prev = &(*prev)->next);
|
for (prev = &kdConfigPointers; *prev; prev = &(*prev)->next);
|
||||||
|
@ -1067,11 +1067,11 @@ KdGetOptions (InputOption **options, char *string)
|
||||||
newopt->key = (char *)malloc(tam_key);
|
newopt->key = (char *)malloc(tam_key);
|
||||||
strncpy(newopt->key, string, tam_key);
|
strncpy(newopt->key, string, tam_key);
|
||||||
newopt->key[tam_key] = '\0';
|
newopt->key[tam_key] = '\0';
|
||||||
newopt->value = xstrdup(strchr(string, '=') + 1);
|
newopt->value = strdup(strchr(string, '=') + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newopt->key = xstrdup(string);
|
newopt->key = strdup(string);
|
||||||
newopt->value = NULL;
|
newopt->value = NULL;
|
||||||
}
|
}
|
||||||
newopt->next = NULL;
|
newopt->next = NULL;
|
||||||
|
@ -1147,7 +1147,7 @@ KdParseKeyboard (char *arg)
|
||||||
if (strcmp (save, "auto") == 0)
|
if (strcmp (save, "auto") == 0)
|
||||||
ki->driverPrivate = NULL;
|
ki->driverPrivate = NULL;
|
||||||
else
|
else
|
||||||
ki->driverPrivate = xstrdup(save);
|
ki->driverPrivate = strdup(save);
|
||||||
|
|
||||||
if (delim != ',')
|
if (delim != ',')
|
||||||
{
|
{
|
||||||
|
@ -1243,7 +1243,7 @@ KdParsePointer (char *arg)
|
||||||
if (strcmp(save, "auto") == 0)
|
if (strcmp(save, "auto") == 0)
|
||||||
pi->driverPrivate = NULL;
|
pi->driverPrivate = NULL;
|
||||||
else
|
else
|
||||||
pi->driverPrivate = xstrdup(save);
|
pi->driverPrivate = strdup(save);
|
||||||
|
|
||||||
if (delim != ',')
|
if (delim != ',')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue