Tools
authorKen Hughes <khughes@pacific.edu>
Wed, 7 Mar 2007 06:19:15 +0000 (06:19 +0000)
committerKen Hughes <khughes@pacific.edu>
Wed, 7 Mar 2007 06:19:15 +0000 (06:19 +0000)
-----
Bugfix #6174: files larger than (2^31)-1 bytes were reported with negative
sizes in file manager windows.  Added a cast to unsigned int before doing
conversions for the UI.

source/blender/blenlib/intern/storage.c

index f667676117b43340715dbda91ee2747c5a4ede60..a6b91bf489d0ce13d668b08431ddb9b1c19c5e7b 100644 (file)
@@ -387,7 +387,12 @@ void BLI_adddirstrings()
                strftime(files[num].time, 8, "%H:%M", tm);
                strftime(files[num].date, 16, "%d-%b-%y", tm);
 
-               st_size= files[num].s.st_size;
+               /*
+                * Seems st_size is signed 32-bit value in *nix and Windows.  This
+                * will buy us some time until files get bigger than 4GB or until
+                * everyone starts using __USE_FILE_OFFSET64 or equivalent.
+                */
+               st_size= (unsigned int)files[num].s.st_size;
                
                num1= st_size % 1000;
                num2= st_size/1000;