some small misc bug fixes
authorBrenden Matthews <brenden1@rty.ca>
Mon, 5 Sep 2005 02:09:31 +0000 (02:09 +0000)
committerBrenden Matthews <brenden1@rty.ca>
Mon, 5 Sep 2005 02:09:31 +0000 (02:09 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@272 7f574dfc-610e-0410-a909-a81674777703

ChangeLog
Conky.kdevelop
src/conky.c
src/linux.c

index 2ca64f4..ea191ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 # $Id$
 
+2005-09-04
+       * Misc small bug fixes
+
 2005-09-03
        * MPD patch (sf.net patch 1281108)
        * Fixed graph width bug
index 07307a6..f35c35e 100644 (file)
@@ -9,13 +9,13 @@
     <ignoreparts/>
     <projectdirectory>.</projectdirectory>
     <absoluteprojectpath>false</absoluteprojectpath>
-    <description></description>
+    <description/>
     <versioncontrol/>
   </general>
   <kdevautoproject>
     <general>
       <activetarget>conky</activetarget>
-      <useconfiguration>debug-no-x</useconfiguration>
+      <useconfiguration>debug</useconfiguration>
     </general>
     <run>
       <mainprogram>conky</mainprogram>
         <envvars/>
         <configargs>--enable-debug=full --prefix=/usr --enable-mpd --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey --disable-x11 --without-x</configargs>
         <builddir>debug-no-x</builddir>
-        <topsourcedir></topsourcedir>
-        <cppflags></cppflags>
-        <ldflags></ldflags>
+        <topsourcedir/>
+        <cppflags/>
+        <ldflags/>
         <ccompiler>kdevgccoptions</ccompiler>
         <cxxcompiler>kdevgppoptions</cxxcompiler>
         <f77compiler>kdevpgf77options</f77compiler>
-        <ccompilerbinary></ccompilerbinary>
-        <cxxcompilerbinary></cxxcompilerbinary>
-        <f77compilerbinary></f77compilerbinary>
+        <ccompilerbinary/>
+        <cxxcompilerbinary/>
+        <f77compilerbinary/>
         <cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -ggdb</cflags>
-        <cxxflags></cxxflags>
-        <f77flags></f77flags>
+        <cxxflags/>
+        <f77flags/>
       </debug-no-x>
     </configurations>
     <make>
   <kdevdebugger>
     <general>
       <dbgshell>/usr/bin/libtool</dbgshell>
-      <programargs></programargs>
+      <programargs/>
       <gdbpath>/usr/bin/</gdbpath>
-      <configGdbScript></configGdbScript>
-      <runShellScript></runShellScript>
-      <runGdbScript></runGdbScript>
+      <configGdbScript/>
+      <runShellScript/>
+      <runGdbScript/>
       <breakonloadinglibs>true</breakonloadinglibs>
       <separatetty>false</separatetty>
       <floatingtoolbar>false</floatingtoolbar>
       <headerCompletionDelay>250</headerCompletionDelay>
     </codecompletion>
     <creategettersetter>
-      <prefixGet></prefixGet>
+      <prefixGet/>
       <prefixSet>set</prefixSet>
       <prefixVariable>m_,_</prefixVariable>
       <parameterName>theValue</parameterName>
index 05264b1..dcbc46a 100644 (file)
@@ -1295,7 +1295,7 @@ if (s[0] == '#') {
        if (!arg) {
                ERR("i2c needs arguments");
                obj->type = OBJ_text;
-               obj->data.s = strdup("${i2c}");
+               //obj->data.s = strdup("${i2c}");
                return;
        }
 
@@ -1306,12 +1306,12 @@ if (s[0] == '#') {
                obj->data.i2c.fd =
                    open_i2c_sensor(0, buf2, n, &obj->data.i2c.arg,
                                    obj->data.i2c.devtype);
-               strcpy(obj->data.i2c.type, buf2);
+               strncpy(obj->data.i2c.type, buf2, 63);
        } else {
                obj->data.i2c.fd =
                    open_i2c_sensor(buf1, buf2, n, &obj->data.i2c.arg,
                                    obj->data.i2c.devtype);
-               strcpy(obj->data.i2c.type, buf2);
+               strncpy(obj->data.i2c.type, buf2, 63);
        }
 
        END OBJ(top, INFO_TOP)
@@ -1320,7 +1320,7 @@ if (s[0] == '#') {
        if (!arg) {
                ERR("top needs arguments");
                obj->type = OBJ_text;
-               obj->data.s = strdup("${top}");
+               //obj->data.s = strdup("${top}");
                return;
        }
        if (sscanf(arg, "%63s %i", buf, &n) == 2) {
@@ -2916,7 +2916,7 @@ static void generate_text()
                                        else {
                                                obj->data.tail.readlines = 0;
 
-                                               while (fgets(obj->data.tail.buffer, TEXT_BUFFER_SIZE*4, fp) != NULL) {
+                                               while (fgets(obj->data.tail.buffer, TEXT_BUFFER_SIZE*20, fp) != NULL) {
                                                        if (added >= 30) {
                                                                freelasttail(head);
                                                        }
@@ -2941,7 +2941,7 @@ static void generate_text()
                                                        headtmp = headtmp->next;
                                                        for (i = 1;i < obj->data.tail.wantedlines + 1 && i < obj->data.tail.readlines; i++) {
                                                                if (headtmp) {
-                                                                       strncat(obj->data.tail.buffer, headtmp->data, (TEXT_BUFFER_SIZE * 20 / obj->data.tail.wantedlines) - strlen(obj->data.tail.buffer)); /* without strlen() at the end this becomes a possible */
+                                                                       strncat(obj->data.tail.buffer, headtmp->data, (TEXT_BUFFER_SIZE * 20) - strlen(obj->data.tail.buffer)); /* without strlen() at the end this becomes a possible */
                                                                        headtmp = headtmp->next;
                                                                }
                                                        }
@@ -2976,7 +2976,7 @@ static void generate_text()
                                        }
                                        else {
                                                obj->data.tail.readlines = 0;
-                                               while (fgets(obj->data.tail.buffer, TEXT_BUFFER_SIZE*4, fp) != NULL && obj->data.tail.readlines <= obj->data.tail.wantedlines) {
+                                               while (fgets(obj->data.tail.buffer, TEXT_BUFFER_SIZE*20, fp) != NULL && obj->data.tail.readlines <= obj->data.tail.wantedlines) {
                                                        addtail(&head, obj->data.tail.buffer);
                                                        obj->data.tail.readlines++;
                                                }
@@ -2992,7 +2992,7 @@ static void generate_text()
                                                        strcpy(obj->data.tail.buffer, headtmp->data);
                                                        headtmp = headtmp->next;
                                                        while (headtmp) {
-                                                               strncat(obj->data.tail.buffer, headtmp->data, (TEXT_BUFFER_SIZE * 20 / obj->data.tail.wantedlines) - strlen(obj->data.tail.buffer)); /* without strlen() at the end this becomes a possible */
+                                                               strncat(obj->data.tail.buffer, headtmp->data, (TEXT_BUFFER_SIZE * 20) - strlen(obj->data.tail.buffer)); /* without strlen() at the end this becomes a possible */
                                                                headtmp = headtmp->next;
                                                        }
                                                        freetail(freetmp);
index 2bcf7ed..8fb843d 100644 (file)
@@ -579,12 +579,11 @@ open_i2c_sensor(const char *dev, const char *type, int n, int *div,
                type = "in";
 
        if (strcmp(type, "tempf") == 0) {
-               snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, "temp",
-                        n);
+               snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, "temp", n);
        } else {
                snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, type, n);
        }
-       strcpy(devtype, path);
+       strncpy(devtype, path, 255);
 
        /* open file */
        fd = open(path, O_RDONLY);