X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=highscores.h;h=3a2071758a8c04f76c6ddd8d5a2a1ead67d1c62d;hb=5d5d5f394cbe2212769bc58a70fa622b4ed46205;hp=257ff694c79ab64ff9a0643b5537a973f5ef1ab3;hpb=2383f834f7c7890b12fd4fee9387f4cd3ca3b1e0;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/highscores.h b/highscores.h index 257ff69..3a20717 100644 --- a/highscores.h +++ b/highscores.h @@ -478,14 +478,14 @@ VG_STATIC void highscore_strr( char *buf, const char *str, int len, int width ) } } -/* Print integer (padded with: alt), right aligned into buf(width: len) */ -VG_STATIC void highscore_intr( char *buf, int value, int len, char alt ) +/* Print integer (padded with: alt), right aligned into buf(width: len) + * returns number of digits (not including alt), that were written to buf */ +VG_STATIC int highscore_intr( char *buf, int value, int len, char alt ) { int i=0; - while(value) - { + while(value){ if( i>=len ) - return; + return i; buf[ len-1 - (i ++) ] = '0' + (value % 10); value /= 10; @@ -493,16 +493,18 @@ VG_STATIC void highscore_intr( char *buf, int value, int len, char alt ) for( ;i=len ) break; @@ -514,9 +516,9 @@ VG_STATIC void highscore_intl( char *buf, int value, int len ) i = len; for( int j=0; jplayerid == 0x011000010162c41e ) { i --; + /* FIXME: Clear line, or yknow, do it properly */ } }