src/init.c: bail out if skin_name or font_name is "".
Fixes a crash on AROS src/filesel.c: fixed BSTR conversion routine for AROS. Without this fix "RAM DISK" was printed as "AM DISK" in the file selector. src/setup.c: removed slash to avoid that paths like "PROGDIR:/share" are created on AROS. That fix should be right for all Amiga like OS but I don't want to change things which I can't test. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1970 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									7613093df9
								
							
						
					
					
						commit
						113d6423b4
					
				@ -470,16 +470,21 @@ void bstrtostr( BSTR in, STRPTR out, TEXT max )
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  STRPTR iptr;
 | 
					  STRPTR iptr;
 | 
				
			||||||
  dword i;
 | 
					  dword i;
 | 
				
			||||||
 | 
					  dword len;
 | 
				
			||||||
  iptr = BADDR( in );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if( max > iptr[0] ) max = iptr[0];
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__AROS__)
 | 
					#if defined(__AROS__)
 | 
				
			||||||
  for ( i=0 ; i<max ; i++ ) out[i] = *(AROS_BSTR_ADDR(iptr+i));
 | 
					  iptr = AROS_BSTR_ADDR( in );
 | 
				
			||||||
 | 
					  len = AROS_BSTR_strlen( in );
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
  for( i=0; i<max; i++ ) out[i] = iptr[i+1];
 | 
					  iptr = BADDR( in );
 | 
				
			||||||
 | 
					  len = iptr[0];
 | 
				
			||||||
 | 
					  iptr++;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if( max > len ) max = len;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for( i=0; i<max; i++ , iptr++ ) out[i] = *iptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  out[i] = 0;
 | 
					  out[i] = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										12
									
								
								src/init.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/init.c
									
									
									
									
									
								
							@ -664,6 +664,12 @@ T_Gui_skin * Load_graphics(const char * skin_file, T_Gradient_array *gradients)
 | 
				
			|||||||
  char filename[MAX_PATH_CHARACTERS];
 | 
					  char filename[MAX_PATH_CHARACTERS];
 | 
				
			||||||
  SDL_Surface * gui;
 | 
					  SDL_Surface * gui;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (skin_file[0] == '\0')
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    sprintf(Gui_loading_error_message, "Wrong skin file name \"\"\n");
 | 
				
			||||||
 | 
					    return NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gfx = (T_Gui_skin *)malloc(sizeof(T_Gui_skin));
 | 
					  gfx = (T_Gui_skin *)malloc(sizeof(T_Gui_skin));
 | 
				
			||||||
  if (gfx == NULL)
 | 
					  if (gfx == NULL)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
@ -744,6 +750,12 @@ byte * Load_font(const char * font_name)
 | 
				
			|||||||
  char filename[MAX_PATH_CHARACTERS];
 | 
					  char filename[MAX_PATH_CHARACTERS];
 | 
				
			||||||
  SDL_Surface * image;
 | 
					  SDL_Surface * image;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (font_name[0] == '\0')
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    sprintf(Gui_loading_error_message, "Wrong font name \"\"\n");
 | 
				
			||||||
 | 
					    return NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  font = (byte *)malloc(8*8*256);
 | 
					  font = (byte *)malloc(8*8*256);
 | 
				
			||||||
  if (font == NULL)
 | 
					  if (font == NULL)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
 | 
				
			|||||||
@ -134,7 +134,7 @@ void Set_data_directory(const char * program_dir, char * data_dir)
 | 
				
			|||||||
    strcpy(data_dir, program_dir);
 | 
					    strcpy(data_dir, program_dir);
 | 
				
			||||||
  // All other targets, program is in a "bin" subdirectory
 | 
					  // All other targets, program is in a "bin" subdirectory
 | 
				
			||||||
  #elif defined (__AROS__)
 | 
					  #elif defined (__AROS__)
 | 
				
			||||||
    strcat(data_dir,"/share/grafx2/");
 | 
					    strcat(data_dir,"share/grafx2/");
 | 
				
			||||||
  #else
 | 
					  #else
 | 
				
			||||||
    strcat(data_dir,"../share/grafx2/");
 | 
					    strcat(data_dir,"../share/grafx2/");
 | 
				
			||||||
  #endif
 | 
					  #endif
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user