From ee9f6f34322911ea99a9bd935dadc5b471696226 Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Thu, 12 Jan 2012 13:07:37 -0700 Subject: [PATCH] Fix mismatched field precision type compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileSystem.cc b/src/FileSystem.cc index 9ed19ea7..fe5ea5ae 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(