From: Stefan Reinauer Date: Thu, 21 May 2026 00:37:36 +0000 (-0700) Subject: isofs: avoid undefined timezone sign extension X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=17c59f8f683050453f2338fea691131c6584d14c;p=francis%2Fwinuae.git isofs: avoid undefined timezone sign extension make_date() sign-extends the ISO9660 timezone byte when the high bit is set. (-1 << 8) shifts a negative signed value, which is undefined behavior in C++. Use ~0xff to build the same extension mask without relying on that undefined shift. --- diff --git a/isofs.cpp b/isofs.cpp index d40bd1b9..5fb47a30 100644 --- a/isofs.cpp +++ b/isofs.cpp @@ -328,7 +328,7 @@ static int make_date(int year, int month, int day, int hour, int minute, int sec /* sign extend */ if (tz & 0x80) - tz |= (-1 << 8); + tz |= ~0xff; /* * The timezone offset is unreliable on some disks,