username medals display
[carveJwlIkooP6JGAAIwe30JlM.git] / steam.h
diff --git a/steam.h b/steam.h
index 730784ea1cef0feed774b05d39c054c22df116b6..cbe88eef63b67d92cbdab643d61c421b46755403 100644 (file)
--- a/steam.h
+++ b/steam.h
@@ -27,7 +27,7 @@
  * nothing.
  */
 
-static char steam_username_at_startup[128];
+static char steam_username_at_startup[128] = "Unassigned";
 
 static void recv_steam_warning( int severity, const char *msg )
 {
@@ -171,13 +171,12 @@ static u32 utf8_byte0_byte_count( u8 char0 )
    return 0;
 }
 
-static void str_utf8_collapse( const char *str, char *buf, u32 length )
-{
+static u32 str_utf8_collapse( const char *str, char *buf, u32 length ){
    u8 *ustr = (u8 *)str;
    u32 utf32_code = 0x00000000;
    u32 i=0, j=0, utf32_byte_ct=0;
 
-   for(;i < length-1;){
+   for(;j < length-1;){
       if( ustr[i] == 0x00 )
          break;
       
@@ -210,6 +209,7 @@ static void str_utf8_collapse( const char *str, char *buf, u32 length )
    }
 
    buf[j] = 0x00;
+   return j;
 }
 
 static int steam_init(void){