replaced atoi with atol .

* replaced atoi with atol .
This commit is contained in:
Bart Hakvoort 2004-12-29 20:39:29 +00:00
parent 169f1e34f9
commit 8763f148cb
9 changed files with 17 additions and 13 deletions

View File

@ -1,3 +1,7 @@
2004-12-29 Bart Hakvoort <hakvoort@cvs.gnome.org>
* replaced atoi with atol .
2004-12-29 Bart Hakvoort <hakvoort@cvs.gnome.org>
* src/jfs.cc: implemented read used/unused space on a jfs filesystem.

View File

@ -545,7 +545,7 @@ void GParted_Core::Set_Used_Sectors( Partition & partition )
//we need the 4th value
file_input >> temp; file_input >> temp; file_input >> temp;file_input >> temp;
if ( ! temp .empty( ) )
partition .Set_Unused( atoi( temp .c_str( ) ) * 1024/512 ) ;
partition .Set_Unused( atol( temp .c_str( ) ) * 2 ) ;// 1024/512
file_input .close( );
system( "rm -f /tmp/.tmp_gparted" );

View File

@ -66,11 +66,11 @@ void ext2::Set_Used_Sectors( Partition & partition )
//free blocks
if ( output .find( "Free blocks" ) < output .length( ) )
free_blocks = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
free_blocks = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
//blocksize
if ( output .find( "Block size" ) < output .length( ) )
blocksize = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
blocksize = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
}
pclose( f ) ;

View File

@ -66,11 +66,11 @@ void ext3::Set_Used_Sectors( Partition & partition )
//free blocks
if ( output .find( "Free blocks" ) < output .length( ) )
free_blocks = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
free_blocks = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
//blocksize
if ( output .find( "Block size" ) < output .length( ) )
blocksize = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
blocksize = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
}
pclose( f ) ;

View File

@ -57,7 +57,7 @@ void hfs::Set_Used_Sectors( Partition & partition )
{
output = output .substr( 0, output .find( " bytes free" ) ) ;
partition .Set_Unused( atoi( (output .substr( output .find_last_of( ' ' ) ) ) .c_str( ) ) / 512 ) ;
partition .Set_Unused( atol( (output .substr( output .find_last_of( ' ' ) ) ) .c_str( ) ) / 512 ) ;
break ;
}
}

View File

@ -67,7 +67,7 @@ void ntfs::Set_Used_Sectors( Partition & partition )
//free sectors
if ( output .find( "sectors of free space" ) < output .length( ) )
{
partition .Set_Unused( atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ) ;
partition .Set_Unused( atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ) ;
break ;
}
}

View File

@ -70,11 +70,11 @@ void reiser4::Set_Used_Sectors( Partition & partition )
//blocksize
if ( output .find( "blksize" ) < output .length( ) )
blocksize = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
blocksize = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
//free blocks
if ( output .find( "free blocks" ) < output .length( ) )
free_blocks = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
free_blocks = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
}
pclose( f ) ;

View File

@ -70,11 +70,11 @@ void reiserfs::Set_Used_Sectors( Partition & partition )
//blocksize
if ( output .find( "Blocksize" ) < output .length( ) )
blocksize = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
blocksize = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
//free blocks
if ( output .find( "Free blocks" ) < output .length( ) )
free_blocks = atoi( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
free_blocks = atol( (output .substr( output .find( ":" ) +1, output .length( ) ) ) .c_str( ) ) ;
}
pclose( f ) ;

View File

@ -75,11 +75,11 @@ void xfs::Set_Used_Sectors( Partition & partition )
//free blocks
if ( output .find( "fdblocks" ) < output .length( ) )
free_blocks = atoi( (output .substr( output .find( "=" ) +1, output .length( ) ) ) .c_str( ) ) ;
free_blocks = atol( (output .substr( output .find( "=" ) +1, output .length( ) ) ) .c_str( ) ) ;
//blocksize
if ( output .find( "blocksize" ) < output .length( ) )
blocksize = atoi( (output .substr( output .find( "=" ) +1, output .length( ) ) ) .c_str( ) ) ;
blocksize = atol( (output .substr( output .find( "=" ) +1, output .length( ) ) ) .c_str( ) ) ;
}
pclose( f ) ;