summaryrefslogtreecommitdiff
path: root/sfeed_frames.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-05-13 10:07:52 +0000
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-05-13 10:07:52 +0000
commitc334bcf1862a48ebb37e80aca319d4aa5baad061 (patch)
tree227c6be05a7d77120859ebd766e8fea1468407d9 /sfeed_frames.c
parentc3b5da658eeef51b1444060aa107fc413ea0f436 (diff)
cleanup, tested with tcc
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat (limited to 'sfeed_frames.c')
-rw-r--r--sfeed_frames.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sfeed_frames.c b/sfeed_frames.c
index 679437b..bc08c22 100644
--- a/sfeed_frames.c
+++ b/sfeed_frames.c
@@ -13,18 +13,15 @@
#include "util.h"
static unsigned int showsidebar = 1; /* show sidebar ? */
-
static FILE *fpindex = NULL, *fpitems = NULL, *fpmenu = NULL;
static FILE *fpcontent = NULL;
static char *line = NULL;
static struct feed *feeds = NULL;
-/* print string to stderr and exit program with EXIT_FAILURE */
+/* print error message to stderr */
static void
die(const char *s) {
- fputs("sfeed_frames: ", stderr);
- fputs(s, stderr);
- fputc('\n', stderr);
+ fprintf(stderr, "sfeed_frames: %s\n", s);
exit(EXIT_FAILURE);
}
@@ -98,10 +95,9 @@ main(int argc, char **argv) {
struct feed *f, *fcur = NULL;
char *fields[FieldLast];
char name[64]; /* TODO: bigger size? */
- char *basepath = ".";
char dirpath[PATH_MAX], filepath[PATH_MAX];
char reldirpath[PATH_MAX], relfilepath[PATH_MAX];
- char *feedname = "";
+ char *feedname = "", *basepath = ".";
unsigned long totalfeeds = 0, totalnew = 0;
unsigned int isnew;
time_t parsedtime, comparetime;
@@ -226,7 +222,7 @@ main(int argc, char **argv) {
contenttime.modtime = parsedtime;
utime(filepath, &contenttime);
- isnew = (parsedtime >= comparetime);
+ isnew = (parsedtime >= comparetime) ? 1 : 0;
totalnew += isnew;
fcur->totalnew += isnew;
fcur->total++;