summaryrefslogtreecommitdiff
path: root/sfeed.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-04-09 12:17:52 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-04-09 12:17:52 +0200
commit86e3df6c1114896289ace70c28de4e38cda8b6ba (patch)
tree5f35441581d40fb52f829103209cfe255e7c8b3d /sfeed.c
parent2da778ee1d976748dbb69c731264c34d8fc0316a (diff)
sfeed: dont use LEN(), just check if formats[i] is null
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat (limited to 'sfeed.c')
-rw-r--r--sfeed.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sfeed.c b/sfeed.c
index 00ab6da..48cf87e 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -9,7 +9,6 @@
#include "xml.h"
#define ISWSNOSPACE(c) (((unsigned)c - '\t') < 5) /* isspace(c) && c != ' ' */
-#define LEN(x) (sizeof (x) / sizeof *(x))
enum { FeedTypeNone = 0, FeedTypeRSS = 1, FeedTypeAtom = 2 };
static const char *feedtypes[] = { "", "rss", "atom" };
@@ -337,7 +336,7 @@ parsetime(const char *s, char *buf, size_t bufsiz) {
if(buf)
buf[0] = '\0';
memset(&tm, 0, sizeof(tm));
- for(i = 0; i < LEN(formats); i++) {
+ for(i = 0; i < formats[i]; i++) {
if((p = strptime(s, formats[i], &tm))) {
tm.tm_isdst = -1; /* don't use DST */
if((t = mktime(&tm)) == -1) /* error */