touch: fix SEGV if !ENABLE_FEATURE_TOUCH_SUSV3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2021-08-15 20:23:40 +02:00
parent eaa8ee40aa
commit ac2d4d88ce

View File

@ -127,6 +127,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
#endif #endif
); );
#if ENABLE_FEATURE_TOUCH_SUSV3
timebuf[0].tv_nsec = timebuf[1].tv_nsec = UTIME_NOW; timebuf[0].tv_nsec = timebuf[1].tv_nsec = UTIME_NOW;
if (opts & OPT_r) { if (opts & OPT_r) {
struct stat stbuf; struct stat stbuf;
@ -160,6 +161,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
timebuf[1].tv_nsec = UTIME_OMIT; timebuf[1].tv_nsec = UTIME_OMIT;
if ((opts & (OPT_a|OPT_m)) == OPT_m) if ((opts & (OPT_a|OPT_m)) == OPT_m)
timebuf[0].tv_nsec = UTIME_OMIT; timebuf[0].tv_nsec = UTIME_OMIT;
#endif
argv += optind; argv += optind;
do { do {