code-style + no need to zero static variables
This commit is contained in:
parent
c4573f3289
commit
29fa81e623
|
@ -15,14 +15,12 @@
|
|||
|
||||
#include "util.h"
|
||||
|
||||
static char *line = NULL;
|
||||
size_t linesize = 0;
|
||||
|
||||
static struct feed **feeds;
|
||||
static char *line;
|
||||
static size_t linesize;
|
||||
static struct utimbuf contenttime;
|
||||
static time_t comparetime;
|
||||
static unsigned long totalnew = 0;
|
||||
|
||||
static struct feed **feeds = NULL;
|
||||
static unsigned long totalnew;
|
||||
|
||||
/* Unescape / decode fields printed by string_print_encoded()
|
||||
* "\\" to "\", "\t", to TAB, "\n" to newline. Unrecognised escape sequences
|
||||
|
|
10
sfeed_html.c
10
sfeed_html.c
|
@ -7,11 +7,11 @@
|
|||
|
||||
#include "util.h"
|
||||
|
||||
static struct feed **feeds = NULL;
|
||||
static int showsidebar = 0; /* show sidebar ? */
|
||||
static char *line = NULL;
|
||||
static size_t linesize = 0;
|
||||
static unsigned long totalnew = 0;
|
||||
static struct feed **feeds;
|
||||
static int showsidebar;
|
||||
static char *line;
|
||||
static size_t linesize;
|
||||
static unsigned long totalnew;
|
||||
static time_t comparetime;
|
||||
|
||||
static void
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
#include "util.h"
|
||||
|
||||
static char *line = NULL;
|
||||
static size_t linesize = 0;
|
||||
static char *line;
|
||||
static size_t linesize;
|
||||
|
||||
/* jenkins one-at-a-time hash, used for Message-Id */
|
||||
static uint32_t
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "util.h"
|
||||
|
||||
static time_t comparetime;
|
||||
static char *line = NULL;
|
||||
static size_t size = 0;
|
||||
static char *line;
|
||||
static size_t linesize;
|
||||
|
||||
/* print `len' columns of characters. If string is shorter pad the rest
|
||||
* with characters `pad`. */
|
||||
|
@ -41,7 +41,7 @@ printfeed(FILE *fp, const char *feedname)
|
|||
char *fields[FieldLast];
|
||||
time_t parsedtime;
|
||||
|
||||
while (parseline(&line, &size, fields, fp) > 0) {
|
||||
while (parseline(&line, &linesize, fields, fp) > 0) {
|
||||
parsedtime = 0;
|
||||
strtotime(fields[FieldUnixTimestamp], &parsedtime);
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name,
|
|||
isfeedlink = 1;
|
||||
strlcpy(feedtype, value, sizeof(feedtype));
|
||||
}
|
||||
} else if (!strncasecmp(name, "href", namelen)) {
|
||||
} else if (!strcasecmp(name, "href")) {
|
||||
strlcpy(feedlink, value, sizeof(feedlink));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "xml.h"
|
||||
|
||||
static XMLParser parser;
|
||||
static int isxmlpi = 0, tags = 0;
|
||||
static int isxmlpi, tags;
|
||||
|
||||
static void
|
||||
xmltagstart(XMLParser *p, const char *tag, size_t taglen)
|
||||
|
@ -42,7 +42,7 @@ xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name,
|
|||
(void)taglen;
|
||||
(void)valuelen;
|
||||
|
||||
if (isxmlpi && (!strncasecmp(name, "encoding", namelen))) {
|
||||
if (isxmlpi && (!strcasecmp(name, "encoding"))) {
|
||||
if (*value) {
|
||||
/* output lowercase */
|
||||
for (; *value; value++)
|
||||
|
@ -57,8 +57,8 @@ int
|
|||
main(void)
|
||||
{
|
||||
parser.xmlattr = xmlattr;
|
||||
parser.xmltagstart = xmltagstart;
|
||||
parser.xmltagend = xmltagend;
|
||||
parser.xmltagstart = xmltagstart;
|
||||
|
||||
xml_parse_fd(&parser, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue