From e0da2d775ac34a06949c554c61d015d076890be6 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 13 May 2014 15:44:13 +0000 Subject: sfeed: fix invalid length parameter Signed-off-by: Hiltjo Posthuma --- sfeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- cgit v1.2.3