changed a number of sprintf's to dpsnprintf and removed the TODO
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 17 Jun 2008 10:17:29 +0000 (10:17 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 17 Jun 2008 10:17:29 +0000 (10:17 +0000)
comments for doing this

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8364 d7cf8633-e32d-0410-b094-e92efae38249

cl_gecko.c

index 653ee2e..ede73ad 100644 (file)
@@ -716,8 +716,7 @@ static void cl_gecko_create_f( void ) {
                return;
        }
 
-       // TODO: use snprintf instead
-       sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1));
+       dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1));
        CL_Gecko_CreateBrowser( name, -1 );
 }
 
@@ -730,8 +729,7 @@ static void cl_gecko_destroy_f( void ) {
                return;
        }
 
-       // TODO: use snprintf instead
-       sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1));
+       dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1));
        CL_Gecko_DestroyBrowser( CL_Gecko_FindBrowser( name ) );
 }
 
@@ -745,8 +743,7 @@ static void cl_gecko_navigate_f( void ) {
                return;
        }
 
-       // TODO: use snprintf instead
-       sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1));
+       dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1));
        URI = Cmd_Argv( 2 );
        CL_Gecko_NavigateToURI( CL_Gecko_FindBrowser( name ), URI );
 }
@@ -763,8 +760,7 @@ static void cl_gecko_injecttext_f( void ) {
                return;
        }
 
-       // TODO: use snprintf instead
-       sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1));
+       dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1));
        instance = CL_Gecko_FindBrowser( name );
        if( !instance ) {
                Con_Printf( "cl_gecko_injecttext_f: gecko instance '%s' couldn't be found!\n", name );
@@ -807,8 +803,7 @@ static void gl_gecko_movecursor_f( void ) {
                return;
        }
 
-       // TODO: use snprintf instead
-       sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1));
+       dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1));
        x = atof( Cmd_Argv( 2 ) );
        y = atof( Cmd_Argv( 3 ) );