mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-02 14:15:46 +01:00
As pointed by Coverity, the type used to calculate the size to allocate was not the right one. It now gets the compiler to deduce it from the variable for which the memory is allocated. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
6f7fa45a99
commit
3aae412588
@@ -103,9 +103,9 @@ void wtokensplit(char *command, char ***argv, int *argc)
|
||||
token = wtokennext(line, &line);
|
||||
if (token) {
|
||||
if (count == 0)
|
||||
*argv = wmalloc(sizeof(char **));
|
||||
*argv = wmalloc(sizeof(**argv));
|
||||
else
|
||||
*argv = wrealloc(*argv, (count + 1) * sizeof(char **));
|
||||
*argv = wrealloc(*argv, (count + 1) * sizeof(**argv));
|
||||
(*argv)[count++] = token;
|
||||
}
|
||||
} while (token != NULL && line != NULL);
|
||||
|
||||
Reference in New Issue
Block a user