1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-02-02 20:18:30 +00:00

some small misc bug fixes

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@272 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Brenden Matthews 2005-09-05 02:09:31 +00:00
parent 471fcabc90
commit 94312d3f66
4 changed files with 28 additions and 26 deletions

View File

@ -1,5 +1,8 @@
# $Id$ # $Id$
2005-09-04
* Misc small bug fixes
2005-09-03 2005-09-03
* MPD patch (sf.net patch 1281108) * MPD patch (sf.net patch 1281108)
* Fixed graph width bug * Fixed graph width bug

View File

@ -9,13 +9,13 @@
<ignoreparts/> <ignoreparts/>
<projectdirectory>.</projectdirectory> <projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath> <absoluteprojectpath>false</absoluteprojectpath>
<description></description> <description/>
<versioncontrol/> <versioncontrol/>
</general> </general>
<kdevautoproject> <kdevautoproject>
<general> <general>
<activetarget>conky</activetarget> <activetarget>conky</activetarget>
<useconfiguration>debug-no-x</useconfiguration> <useconfiguration>debug</useconfiguration>
</general> </general>
<run> <run>
<mainprogram>conky</mainprogram> <mainprogram>conky</mainprogram>
@ -68,18 +68,18 @@
<envvars/> <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> <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> <builddir>debug-no-x</builddir>
<topsourcedir></topsourcedir> <topsourcedir/>
<cppflags></cppflags> <cppflags/>
<ldflags></ldflags> <ldflags/>
<ccompiler>kdevgccoptions</ccompiler> <ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler> <cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler> <f77compiler>kdevpgf77options</f77compiler>
<ccompilerbinary></ccompilerbinary> <ccompilerbinary/>
<cxxcompilerbinary></cxxcompilerbinary> <cxxcompilerbinary/>
<f77compilerbinary></f77compilerbinary> <f77compilerbinary/>
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -ggdb</cflags> <cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -ggdb</cflags>
<cxxflags></cxxflags> <cxxflags/>
<f77flags></f77flags> <f77flags/>
</debug-no-x> </debug-no-x>
</configurations> </configurations>
<make> <make>
@ -97,11 +97,11 @@
<kdevdebugger> <kdevdebugger>
<general> <general>
<dbgshell>/usr/bin/libtool</dbgshell> <dbgshell>/usr/bin/libtool</dbgshell>
<programargs></programargs> <programargs/>
<gdbpath>/usr/bin/</gdbpath> <gdbpath>/usr/bin/</gdbpath>
<configGdbScript></configGdbScript> <configGdbScript/>
<runShellScript></runShellScript> <runShellScript/>
<runGdbScript></runGdbScript> <runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs> <breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty> <separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar> <floatingtoolbar>false</floatingtoolbar>
@ -182,7 +182,7 @@
<headerCompletionDelay>250</headerCompletionDelay> <headerCompletionDelay>250</headerCompletionDelay>
</codecompletion> </codecompletion>
<creategettersetter> <creategettersetter>
<prefixGet></prefixGet> <prefixGet/>
<prefixSet>set</prefixSet> <prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable> <prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName> <parameterName>theValue</parameterName>

View File

@ -1295,7 +1295,7 @@ if (s[0] == '#') {
if (!arg) { if (!arg) {
ERR("i2c needs arguments"); ERR("i2c needs arguments");
obj->type = OBJ_text; obj->type = OBJ_text;
obj->data.s = strdup("${i2c}"); //obj->data.s = strdup("${i2c}");
return; return;
} }
@ -1306,12 +1306,12 @@ if (s[0] == '#') {
obj->data.i2c.fd = obj->data.i2c.fd =
open_i2c_sensor(0, buf2, n, &obj->data.i2c.arg, open_i2c_sensor(0, buf2, n, &obj->data.i2c.arg,
obj->data.i2c.devtype); obj->data.i2c.devtype);
strcpy(obj->data.i2c.type, buf2); strncpy(obj->data.i2c.type, buf2, 63);
} else { } else {
obj->data.i2c.fd = obj->data.i2c.fd =
open_i2c_sensor(buf1, buf2, n, &obj->data.i2c.arg, open_i2c_sensor(buf1, buf2, n, &obj->data.i2c.arg,
obj->data.i2c.devtype); obj->data.i2c.devtype);
strcpy(obj->data.i2c.type, buf2); strncpy(obj->data.i2c.type, buf2, 63);
} }
END OBJ(top, INFO_TOP) END OBJ(top, INFO_TOP)
@ -1320,7 +1320,7 @@ if (s[0] == '#') {
if (!arg) { if (!arg) {
ERR("top needs arguments"); ERR("top needs arguments");
obj->type = OBJ_text; obj->type = OBJ_text;
obj->data.s = strdup("${top}"); //obj->data.s = strdup("${top}");
return; return;
} }
if (sscanf(arg, "%63s %i", buf, &n) == 2) { if (sscanf(arg, "%63s %i", buf, &n) == 2) {
@ -2916,7 +2916,7 @@ static void generate_text()
else { else {
obj->data.tail.readlines = 0; 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) { if (added >= 30) {
freelasttail(head); freelasttail(head);
} }
@ -2941,7 +2941,7 @@ static void generate_text()
headtmp = headtmp->next; headtmp = headtmp->next;
for (i = 1;i < obj->data.tail.wantedlines + 1 && i < obj->data.tail.readlines; i++) { for (i = 1;i < obj->data.tail.wantedlines + 1 && i < obj->data.tail.readlines; i++) {
if (headtmp) { 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; headtmp = headtmp->next;
} }
} }
@ -2976,7 +2976,7 @@ static void generate_text()
} }
else { else {
obj->data.tail.readlines = 0; 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); addtail(&head, obj->data.tail.buffer);
obj->data.tail.readlines++; obj->data.tail.readlines++;
} }
@ -2992,7 +2992,7 @@ static void generate_text()
strcpy(obj->data.tail.buffer, headtmp->data); strcpy(obj->data.tail.buffer, headtmp->data);
headtmp = headtmp->next; headtmp = headtmp->next;
while (headtmp) { 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; headtmp = headtmp->next;
} }
freetail(freetmp); freetail(freetmp);

View File

@ -579,12 +579,11 @@ open_i2c_sensor(const char *dev, const char *type, int n, int *div,
type = "in"; type = "in";
if (strcmp(type, "tempf") == 0) { if (strcmp(type, "tempf") == 0) {
snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, "temp", snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, "temp", n);
n);
} else { } else {
snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, type, n); snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, type, n);
} }
strcpy(devtype, path); strncpy(devtype, path, 255);
/* open file */ /* open file */
fd = open(path, O_RDONLY); fd = open(path, O_RDONLY);