improve linux makefile

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@641 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-03-03 21:53:04 +00:00
parent 0403eead1f
commit 19e1d02745
3 changed files with 57 additions and 34 deletions

View file

@ -94,12 +94,15 @@ void text_out16(int x, int y, const char *texto, ...)
char buffer[256];
int maxw = (SCREEN_WIDTH - x) / 8;
if (maxw < 0)
return;
va_start(args, texto);
vsnprintf(buffer, sizeof(buffer), texto, args);
va_end(args);
if (maxw > 255)
maxw = 255;
if (maxw > sizeof(buffer) - 1)
maxw = sizeof(buffer) - 1;
buffer[maxw] = 0;
text_out16_(x,y,buffer,menu_text_color);
@ -141,9 +144,15 @@ static void smalltext_out16_(int x, int y, const char *texto, int color)
void smalltext_out16(int x, int y, const char *texto, int color)
{
char buffer[SCREEN_WIDTH/6+1];
int maxw = (SCREEN_WIDTH - x) / 6;
if (maxw < 0)
return;
strncpy(buffer, texto, sizeof(buffer));
buffer[sizeof(buffer) - 1] = 0;
if (maxw > sizeof(buffer) - 1)
maxw = sizeof(buffer) - 1;
buffer[maxw] = 0;
smalltext_out16_(x, y, buffer, color);
}