diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-02-27 16:04:45 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-02-27 16:04:45 +0100 |
commit | 1ce0eaeb223072b94d77f5b818e48ae070ba9e5a (patch) | |
tree | 280de9b8e555caa079ccaadb28e4adc9c1fdc661 | |
parent | 70f8136a9b8b916af019e6bb4b6c8e363c7ca34c (diff) |
remove some unneeded checks
-rw-r--r-- | sfeed.c | 1 | ||||
-rw-r--r-- | sfeed_frames.c | 4 |
2 files changed, 2 insertions, 3 deletions
@@ -342,7 +342,6 @@ parsetime(const char *s, char *buf, size_t bufsiz, time_t *tp) size_t i; int tzoffset, r; - memset(&tm, 0, sizeof(tm)); for (i = 0; formats[i]; i++) { if (!(p = strptime(s, formats[i], &tm))) continue; diff --git a/sfeed_frames.c b/sfeed_frames.c index 28bfa61..57efdf3 100644 --- a/sfeed_frames.c +++ b/sfeed_frames.c @@ -120,8 +120,8 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) if (!(namelen = normalizepath(feedname, name, sizeof(name)))) return; - if (strlcpy(dirpath, name, sizeof(dirpath)) >= sizeof(dirpath)) - errx(1, "strlcpy: path truncation"); + strlcpy(dirpath, name, sizeof(dirpath)); + /* directory doesn't exist: try to create it. */ if (stat(dirpath, &st) == -1 && mkdir(dirpath, S_IRWXU) == -1) err(1, "mkdir: %s", dirpath); |