From 8763f148cb06f7b8eea687e50ba208240c9d4f0c Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Wed, 29 Dec 2004 20:39:29 +0000 Subject: [PATCH] replaced atoi with atol . * replaced atoi with atol . --- ChangeLog | 4 ++++ src/GParted_Core.cc | 2 +- src/ext2.cc | 4 ++-- src/ext3.cc | 4 ++-- src/hfs.cc | 2 +- src/ntfs.cc | 2 +- src/reiser4.cc | 4 ++-- src/reiserfs.cc | 4 ++-- src/xfs.cc | 4 ++-- 9 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ed09abb..3fceee9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-12-29 Bart Hakvoort + + * replaced atoi with atol . + 2004-12-29 Bart Hakvoort * src/jfs.cc: implemented read used/unused space on a jfs filesystem. diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 1b13d215..17ada152 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -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" ); diff --git a/src/ext2.cc b/src/ext2.cc index e8a7b937..418f78e4 100644 --- a/src/ext2.cc +++ b/src/ext2.cc @@ -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 ) ; diff --git a/src/ext3.cc b/src/ext3.cc index e150a2fc..b118563e 100644 --- a/src/ext3.cc +++ b/src/ext3.cc @@ -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 ) ; diff --git a/src/hfs.cc b/src/hfs.cc index 064e2543..987dac09 100644 --- a/src/hfs.cc +++ b/src/hfs.cc @@ -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 ; } } diff --git a/src/ntfs.cc b/src/ntfs.cc index f0f04a63..db6ca362 100644 --- a/src/ntfs.cc +++ b/src/ntfs.cc @@ -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 ; } } diff --git a/src/reiser4.cc b/src/reiser4.cc index e5e9d2a5..b6ac872d 100644 --- a/src/reiser4.cc +++ b/src/reiser4.cc @@ -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 ) ; diff --git a/src/reiserfs.cc b/src/reiserfs.cc index 737da41a..085c75b2 100644 --- a/src/reiserfs.cc +++ b/src/reiserfs.cc @@ -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 ) ; diff --git a/src/xfs.cc b/src/xfs.cc index bb94db93..0ed82960 100644 --- a/src/xfs.cc +++ b/src/xfs.cc @@ -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 ) ;