Skip to content

Commit cc9627b

Browse files
committed
date: Don't mix declarations and code
Fixes #91.
1 parent 919d6a7 commit cc9627b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libexslt/date.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,14 @@ _exsltDateParseGYear (exsltDateValPtr dt, const xmlChar **str)
244244
static void
245245
exsltFormatGYear(xmlChar **cur, xmlChar *end, long yr)
246246
{
247+
long year;
248+
xmlChar tmp_buf[100], *tmp = tmp_buf, *tmp_end = tmp_buf + 99;
249+
247250
if (yr <= 0 && *cur < end) {
248251
*(*cur)++ = '-';
249252
}
250253

251-
long year = (yr <= 0) ? -yr + 1 : yr;
252-
xmlChar tmp_buf[100], *tmp = tmp_buf, *tmp_end = tmp_buf + 99;
254+
year = (yr <= 0) ? -yr + 1 : yr;
253255
/* result is in reverse-order */
254256
while (year > 0 && tmp < tmp_end) {
255257
*tmp++ = '0' + (xmlChar)(year % 10);

0 commit comments

Comments
 (0)