Fix if_existing
authorAlexander Graf <agraf@znc.in>
Sat, 30 May 2009 20:20:16 +0000 (22:20 +0200)
committerBrenden Matthews <brenden@rty.ca>
Sat, 30 May 2009 22:21:42 +0000 (16:21 -0600)
The if_existing with 2 arguments checking whether a file contains a specified
string did not work. This is fixed by this patch.

Signed-off-by: Brenden Matthews <brenden@rty.ca>

src/conky.c

index 7bb31db..30885c0 100644 (file)
@@ -412,11 +412,10 @@ int check_contains(char *f, char *s)
        FILE *where = open_file(f, 0);
 
        if (where) {
-               char buf1[256], buf2[256];
+               char buf1[256];
 
                while (fgets(buf1, 256, where)) {
-                       sscanf(buf1, "%255s", buf2);
-                       if (strstr(buf2, s)) {
+                       if (strstr(buf1, s)) {
                                ret = 1;
                                break;
                        }