rc-misc.c: Allocate memory for 'file'

This is a partial revert of commit 8e02406d ("rc-misc.c: remove
references to PATH_MAX"), which changed 'file' to a null pointer with no
associated storage.

../openrc-0.44.10/src/rc/rc-misc.c: In function ‘_rc_deptree_load’:
../openrc-0.44.10/src/rc/rc-misc.c:392:33: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
392 |                                 eerror("Clock skew detected with `%s'", file);
    |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 8e02406d ("rc-misc.c: remove references to PATH_MAX")
Closes: #493
This commit is contained in:
Matt Turner 2022-01-24 11:31:37 -08:00 committed by William Hubbs
parent 0f8fe2a6cb
commit e6d48ea141

View File

@ -362,7 +362,7 @@ RC_DEPTREE * _rc_deptree_load(int force, int *regen)
int serrno = errno;
int merrno;
time_t t;
char *file = NULL;
char file[PATH_MAX];
struct stat st;
struct utimbuf ut;
FILE *fp;