From ad6182343997a405079870a2fe91c4e0c6b94595 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 25 Sep 2019 19:33:39 +0100 Subject: gentoo resync : 25.09.2019 --- ...808-Fix_Dereferencing_type-punned_pointer.patch | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 media-tv/mythtv/files/mythtv-30.0_p20190808-Fix_Dereferencing_type-punned_pointer.patch (limited to 'media-tv/mythtv/files/mythtv-30.0_p20190808-Fix_Dereferencing_type-punned_pointer.patch') diff --git a/media-tv/mythtv/files/mythtv-30.0_p20190808-Fix_Dereferencing_type-punned_pointer.patch b/media-tv/mythtv/files/mythtv-30.0_p20190808-Fix_Dereferencing_type-punned_pointer.patch new file mode 100644 index 000000000000..bc0751c887c3 --- /dev/null +++ b/media-tv/mythtv/files/mythtv-30.0_p20190808-Fix_Dereferencing_type-punned_pointer.patch @@ -0,0 +1,34 @@ +--- a/libs/libmythfreemheg/Programs.cpp ++++ b/libs/libmythfreemheg/Programs.cpp +@@ -232,7 +232,10 @@ void MHResidentProgram::CallProgram(bool fIsFork, const MHObjectRef &success, co + for (int i = 0; i < format.Size(); i++) + { + unsigned char ch = format.GetAt(i); +- char buffer[5]; // Largest text is 4 chars for a year + null terminator ++ // Largest text is 4 chars for a year + null terminator ++ // But... adding a constant to the value might be 5 chars + null terminator ++ // Using 6 gets rid of compiler warning ++ char buffer[6]; + + if (ch == '%') + { +@@ -249,16 +252,16 @@ void MHResidentProgram::CallProgram(bool fIsFork, const MHObjectRef &success, co + switch (ch) + { + case 'Y': +- sprintf(buffer, "%04d", timeStr->tm_year + 1900); ++ sprintf(buffer, "%04d", (unsigned short)(timeStr->tm_year + 1900)); + break; + case 'y': + sprintf(buffer, "%02d", timeStr->tm_year % 100); + break; + case 'X': +- sprintf(buffer, "%02d", timeStr->tm_mon + 1); ++ sprintf(buffer, "%02d", (unsigned short)(timeStr->tm_mon + 1)); + break; + case 'x': +- sprintf(buffer, "%1d", timeStr->tm_mon + 1); ++ sprintf(buffer, "%1d", (unsigned short)(timeStr->tm_mon + 1)); + break; + case 'D': + sprintf(buffer, "%02d", timeStr->tm_mday); -- cgit v1.2.3