This also works:

```diff
diff --git a/geanylua/glspi_app.c b/geanylua/glspi_app.c
index ed82d5eb..23818170 100644
--- a/geanylua/glspi_app.c
+++ b/geanylua/glspi_app.c
@@ -418,11 +418,11 @@ static gint glspi_launch(lua_State* L)
        gchar **argv=NULL;
        gboolean rv;
        GError *err=NULL;
-       if (argc==0) { return FAIL_STRING_ARG(1); }
+       if (argc<=0) { return FAIL_STRING_ARG(1); }
        for (i=1;i<=argc;i++) {
                if (!lua_isstring(L,i)) { return FAIL_STRING_ARG(i); }
        }
-       argv=g_malloc0(sizeof(gchar *)*argc+1);
+       argv=g_malloc0_n(argc+1, sizeof(gchar *));
        for (i=0;i<argc;i++) {
                argv[i]=(g_strdup(lua_tostring(L,i+1)));
        }
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/646#issuecomment-346599504

Reply via email to