Commit d7156a4a authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

Fix minor load/set glitches

Give OS_GBPB a larger buffer to enumerate the themes, and post filter those that are too long for the gadget (rather than bailing out with a buffer overflow error).
Correct a discrepancy between the gadget buffer size and #define.
Correct the fallback button well colour (when not given explicitly) to not be light blue, due to WimpVisualFlags wanting RGB values rather than palette entries.

See https://www.riscosopen.org/forum/forums/1/topics/16369?page=3#posts-125961
and https://www.riscosopen.org/forum/forums/4/topics/16741
and https://www.riscosopen.org/forum/forums/5/topics/16708#posts-125707

Version 0.07. Tagged as 'ThemeSetup-0_07'
parent 50ef6719
No preview for this file type
/* (0.06)
/* (0.07)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.06
#define Module_MajorVersion_CMHG 0.07
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Jul 2021
#define Module_Date_CMHG 22 Sep 2021
#define Module_MajorVersion "0.06"
#define Module_Version 6
#define Module_MajorVersion "0.07"
#define Module_Version 7
#define Module_MinorVersion ""
#define Module_Date "10 Jul 2021"
#define Module_Date "22 Sep 2021"
#define Module_ApplicationDate "10-Jul-21"
#define Module_ApplicationDate "22-Sep-21"
#define Module_ComponentName "ThemeSetup"
#define Module_FullVersion "0.06"
#define Module_HelpVersion "0.06 (10 Jul 2021)"
#define Module_LibraryVersionInfo "0:6"
#define Module_FullVersion "0.07"
#define Module_HelpVersion "0.07 (22 Sep 2021)"
#define Module_LibraryVersionInfo "0:7"
......@@ -731,7 +731,7 @@ void scan_installed_themes(void)
{
int load; int exec; int length;
int attr; int object;
char name[ThemeNameLen];
char name[256];
} info;
while ((e == NULL) && (pos != -1))
......@@ -744,6 +744,9 @@ void scan_installed_themes(void)
if ((e == NULL) && (num > 0) && (info.object == object_directory))
{
/* Check name will fit in the gadget */
if (strlen(info.name) >= ThemeNameLen) continue;
/* Check at least one thing is there */
if (!theme_ifthere(info.name, "Banner", FileType_Sprite) &&
!theme_ifthere(info.name, "Sprites", FileType_Sprite) &&
......
......@@ -48,7 +48,7 @@ typedef struct
0xFFFFFF, 0x999999, \
0xFFFFFF, 0xBBBBBB, \
0x777777, 0xDDDDDD, \
0xBBEEEE, 0x999999, \
0xEEEEBB, 0x999999, \
0x000000
typedef struct theme
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment