diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-05-13 15:44:13 +0000 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-05-13 15:44:13 +0000 |
commit | e0da2d775ac34a06949c554c61d015d076890be6 (patch) | |
tree | 0e72c7d76ef650e0ab34d5a8d32749d189eb7da3 | |
parent | 74ab0e9629125dc9afd029feb822673c8544ead0 (diff) |
sfeed: fix invalid length parameter
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r-- | sfeed.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |