[gparted] Fix mismatched field precision type compiler warning



commit ee9f6f34322911ea99a9bd935dadc5b471696226
Author: Curtis Gedak <gedakc gmail com>
Date:   Thu Jan 12 13:07:37 2012 -0700

    Fix mismatched field precision type compiler warning
    
    Inserted cast to int so that third parameter matches expected
    parameter precision type.
    
    Original warning:
    
    FileSystem.cc: In member function âGlib::ustring
    GParted::FileSystem::mk_temp_dir(const Glib::ustring&,
    GParted::OperationDetail&)â:
    FileSystem.cc:81:69: warning: field precision should have type âintâ,
    but argument 3 has type âlong unsigned intâ

 src/FileSystem.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/FileSystem.cc b/src/FileSystem.cc
index 9ed19ea..fe5ea5a 100644
--- a/src/FileSystem.cc
+++ b/src/FileSystem.cc
@@ -78,7 +78,7 @@ Glib::ustring FileSystem::mk_temp_dir( const Glib::ustring & infix, OperationDet
 	//Secure Programming for Linux and Unix HOWTO, Chapter 6. Avoid Buffer Overflow
 	//  http://tldp.org/HOWTO/Secure-Programs-HOWTO/library-c.html
 	char dir_buf[4096+1];
-	sprintf( dir_buf, "%.*s", sizeof(dir_buf)-1, dir_template .c_str() ) ;
+	sprintf( dir_buf, "%.*s", (int) sizeof(dir_buf)-1, dir_template .c_str() ) ;
 
 	//Looks like "mkdir -v" command was run to the user
 	operationdetail .add_child( OperationDetail(



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]