Fix a typo and teach linux code to use data
authorNikos Ntarmos <ntarmos@cs.uoi.gr>
Sat, 28 Mar 2009 17:47:53 +0000 (19:47 +0200)
committerPhil Sutter <phil@nwl.cc>
Sun, 29 Mar 2009 00:25:33 +0000 (01:25 +0100)
Typo: __LINUX__ was used in a conditional code block, while the rest of
      the code uses __linux__

data: free_text_objects(...) #define's 'data' to be 'obj->data' to make
  the code more compact. The linux-specific parts of the code still
  used obj->data, which should expand to obj->obj->data, which is
  wrong.

Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>

src/conky.c

index fc4fee2..a28530e 100644 (file)
@@ -716,17 +716,17 @@ static void free_text_objects(struct text_object *root)
                                free_iconv();
                                break;
 #endif
-#ifdef __LINUX__
+#ifdef __linux__
                        case OBJ_disk_protect:
-                               free(obj->data.s);
+                               free(data.s);
                                break;
                        case OBJ_if_up:
-                               free(obj->data.ifblock.s);
-                               free(obj->data.ifblock.str);
+                               free(data.ifblock.s);
+                               free(data.ifblock.str);
                                break;
                        case OBJ_if_gw:
-                               free(obj->data.ifblock.s);
-                               free(obj->data.ifblock.str);
+                               free(data.ifblock.s);
+                               free(data.ifblock.str);
                        case OBJ_gw_iface:
                        case OBJ_gw_ip:
                                if (info.gw_info.iface) {
@@ -739,8 +739,8 @@ static void free_text_objects(struct text_object *root)
                                }
                                break;
                        case OBJ_ioscheduler:
-                               if(obj->data.s)
-                                       free(obj->data.s);
+                               if(data.s)
+                                       free(data.s);
                                break;
 #endif
 #ifdef XMMS2