Skip to content

Commit 2a00317

Browse files
committed
patch 9.0.1413: compiler warning for unused variable
Problem: Compiler warning for unused variable. Solution: Move variable declaration. (John Marriott)
1 parent 6e377ec commit 2a00317

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/time.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,24 +258,21 @@ f_reltimefloat(typval_T *argvars UNUSED, typval_T *rettv)
258258
void
259259
f_reltimestr(typval_T *argvars UNUSED, typval_T *rettv)
260260
{
261-
static char buf[50];
262-
# ifdef FEAT_RELTIME
263-
proftime_T tm;
264-
# endif
265-
266261
rettv->v_type = VAR_STRING;
267262
rettv->vval.v_string = NULL;
268263
# ifdef FEAT_RELTIME
269264
if (in_vim9script() && check_for_list_arg(argvars, 0) == FAIL)
270265
return;
271266

267+
proftime_T tm;
272268
if (list2proftime(&argvars[0], &tm) == OK)
273269
{
274270
# ifdef MSWIN
275271
rettv->vval.v_string = vim_strsave((char_u *)profile_msg(&tm));
276272
# else
273+
static char buf[50];
277274
long usec = tm.tv_fsec / (TV_FSEC_SEC / 1000000);
278-
sprintf(buf, "%3ld.%06ld", (long)tm.tv_sec, usec);
275+
vim_snprintf(buf, sizeof(buf), "%3ld.%06ld", (long)tm.tv_sec, usec);
279276
rettv->vval.v_string = vim_strsave((char_u *)buf);
280277
# endif
281278
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1413,
698700
/**/
699701
1412,
700702
/**/

0 commit comments

Comments
 (0)