]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Cast lua_tostring return value to char *
authorWolfgang Stöggl <c72578@yahoo.de>
Tue, 9 Apr 2019 11:35:53 +0000 (13:35 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Tue, 9 Apr 2019 12:39:47 +0000 (14:39 +0200)
- Fixes the following gcc compiler warning:
  rrdlua.c:69:21: warning: assignment discards ‘const’ qualifier from
  pointer target type [-Wdiscarded-qualifiers]
  if (!(argv[i] = lua_tostring (L, i))) {

bindings/lua/rrdlua.c

index d473dbfd72062904d3b5a75c346bae37377aea72..d1a7006410354fdd8f4c726734520af9bd494b9a 100644 (file)
@@ -66,7 +66,7 @@ static char **make_argv(const char *cmd, lua_State * L)
   for (i=1; i<argc; i++) {
     /* accepts string or number */
     if (lua_isstring(L, i) || lua_isnumber(L, i)) {
-      if (!(argv[i] = lua_tostring (L, i))) {
+      if (!(argv[i] = (char *) lua_tostring (L, i))) {
         /* raise an error and never return */
         luaL_error(L, "%s - error duplicating string area for arg #%d",
                    cmd, i);