From dc5a7f1057d841529f4b541d9e6ba9c30e9b38e9 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Fri, 26 Nov 2010 08:17:10 +0100
Source: deets
Version: 0.0.7-1
Status: applied
Debbug: 620834
Subject: [PATCH 3/5] Fix compilation warnings from char arrays usage

The functions expect a pointer to char, which a char array fullfills w/o
need to dereference the variable. This also avoids the need for the
casts.
---
 luau.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/luau.c b/luau.c
index b2993ae..b086004 100644
--- a/luau.c
+++ b/luau.c
@@ -241,7 +241,7 @@ deets_tempstat (lua_State * L)
 	  else
 	    lua_pushstring (L, "other");
 
-	  snprintf (&m, 24, "%0o", s.st_mode & 007777);
+	  snprintf (m, 24, "%0o", s.st_mode & 007777);
 	  lua_pushstring (L, m);
 	  lua_pushnumber (L, s.st_uid);
 	  lua_pushnumber (L, s.st_gid);
@@ -277,38 +277,38 @@ populate_systeminfo (lua_State * L)
   lua_getfield (L, LUA_GLOBALSINDEX, "deets");
   lua_newtable (L);
 
-  i = gethostname ((char *) &buf, 63);
+  i = gethostname (buf, 63);
   lua_pushstring (L, "hostname");
   if (i)
     lua_pushnil (L);
   else
     {
       buf[63] = '\0';
-      lua_pushstring (L, (const char *) &buf);
+      lua_pushstring (L, buf);
       memset (&hints, 0, sizeof (struct addrinfo));
       hints.ai_socktype = SOCK_DGRAM;
       hints.ai_flags = AI_CANONNAME;
 
-      if (getaddrinfo (&buf, NULL, &hints, &carne_de))
+      if (getaddrinfo (buf, NULL, &hints, &carne_de))
 	carne_de = NULL;
     }
   lua_rawset (L, -3);
 
   lua_pushstring (L, "fqdn");
   if (carne_de && carne_de->ai_canonname)
-    lua_pushstring (L, (const char *) carne_de->ai_canonname);
+    lua_pushstring (L, carne_de->ai_canonname);
   else
     lua_pushnil (L);
   lua_rawset (L, -3);
 
-  i = getdomainname ((char *) &buf, 63);
+  i = getdomainname (buf, 63);
   lua_pushstring (L, "nis_domainname");
   if (i)
     lua_pushnil (L);
   else
     {
       buf[63] = '\0';
-      lua_pushstring (L, (const char *) &buf);
+      lua_pushstring (L, buf);
     }
   lua_rawset (L, -3);
 
-- 
1.7.4.1

