Skip to content

Commit

Permalink
Fixed Warning of pointer & Empty tooltypes misread
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisamiga committed Jan 7, 2024
1 parent 955d1af commit a129260
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ void initializeIconTooltypes(void)
struct DiskObject *diskObj = GetDiskObjectNew(path);
if(diskObj)
{
// Check if the tooltypes are empty
if (diskObj->do_ToolTypes == NULL)
{
// printf("Empty\n");
NoRoundOption = FALSE;
FreeDiskObject(diskObj);
return;
}

char *buf = AllocVec(sizeof(char) * 256, MEMF_CLEAR);

for (STRPTR *tool_types = diskObj->do_ToolTypes; (buf = *tool_types); ++tool_types)
Expand Down Expand Up @@ -313,7 +322,7 @@ void updateIconTooltypes (void)
}
newToolTypes[1] = NULL;

diskObj->do_ToolTypes = newToolTypes;
diskObj->do_ToolTypes = (STRPTR *)newToolTypes;

LONG errorCode;
BOOL success;
Expand Down

0 comments on commit a129260

Please sign in to comment.