summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-05-13 15:44:13 +0000
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-05-13 15:44:13 +0000
commite0da2d775ac34a06949c554c61d015d076890be6 (patch)
tree0e72c7d76ef650e0ab34d5a8d32749d189eb7da3
parent74ab0e9629125dc9afd029feb822673c8544ead0 (diff)
sfeed: fix invalid length parameter
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r--sfeed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sfeed.c b/sfeed.c
index 4db238e..a42d6bd 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -323,7 +323,7 @@ gettimetz(const char *s, char *buf, size_t bufsiz) {
else if(sscanf(p, "%c%02d%02d", &c, &tzhour, &tzmin) > 0);
else if(sscanf(p, "%c%d", &c, &tzhour) > 0)
tzmin = 0;
- snprintf(buf, sizeof(buf) - 1, "%s%c%02d%02d", tzname, c, tzhour, tzmin);
+ snprintf(buf, bufsiz, "%s%c%02d%02d", tzname, c, tzhour, tzmin);
/* TODO: test + or - offset */
return (tzhour * 3600) + (tzmin * 60) * (c == '-' ? -1 : 1);
}