]> granicus.if.org Git - transmission/commitdiff
(libT) safer environmental variable handling (muks)
authorCharles Kerr <charles@transmissionbt.com>
Mon, 11 Aug 2008 18:33:59 +0000 (18:33 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Mon, 11 Aug 2008 18:33:59 +0000 (18:33 +0000)
libtransmission/platform.c

index d8de8e53c2fccef9727002c4ae9411d010f33ec2..515f1e96e07441de5af90a088cd3fe964f4dc8bb 100644 (file)
@@ -469,7 +469,7 @@ tr_getDefaultConfigDir( void )
 
         if(( s = getenv( "TRANSMISSION_HOME" )))
         {
-            tr_snprintf( path, sizeof( path ), s );
+            tr_strlcpy( path, s, sizeof( path ) );
         }
         else
         {
@@ -523,11 +523,11 @@ tr_getClutchDir( const tr_session * session UNUSED )
 
         if(( s = getenv( "CLUTCH_HOME" )))
         {
-            tr_snprintf( path, sizeof( path ), s );
+            tr_strlcpy( path, s, sizeof( path ) );
         }
         else if(( s = getenv( "TRANSMISSION_WEB_HOME" )))
         {
-            tr_snprintf( path, sizeof( path ), s );
+            tr_strlcpy( path, s, sizeof( path ) );
         }
         else
         {