From: Christophe CURIS <christophe.cu...@free.fr>

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.cu...@free.fr>
---
 WINGs/string.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/WINGs/string.c b/WINGs/string.c
index 5ec333e..a48d8d7 100644
--- a/WINGs/string.c
+++ b/WINGs/string.c
@@ -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);
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to