[Liblas-commits] r1329 - trunk/src/detail

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Jul 31 21:43:22 EDT 2009


Author: hobu
Date: Fri Jul 31 21:43:21 2009
New Revision: 1329
URL: http://liblas.org/changeset/1329

Log:
forwardport r1328

Modified:
   trunk/src/detail/writer10.cpp
   trunk/src/detail/writer11.cpp
   trunk/src/detail/writer12.cpp

Modified: trunk/src/detail/writer10.cpp
==============================================================================
--- trunk/src/detail/writer10.cpp	(original)
+++ trunk/src/detail/writer10.cpp	Fri Jul 31 21:43:21 2009
@@ -213,7 +213,7 @@
     
     int32_t difference = WriteVLR(header);
     if (difference < 0) {
-        header.SetDataOffset(header.GetDataOffset() + difference );
+        header.SetDataOffset(header.GetDataOffset() + abs(difference) );
         WriteVLR(header);
     }
     

Modified: trunk/src/detail/writer11.cpp
==============================================================================
--- trunk/src/detail/writer11.cpp	(original)
+++ trunk/src/detail/writer11.cpp	Fri Jul 31 21:43:21 2009
@@ -213,8 +213,8 @@
     // it returns is the number of bytes we must increase the header
     // by in order for it to contain the VLRs.
     int32_t difference = WriteVLR(header);
-    if (difference != 0) {
-        header.SetDataOffset(header.GetDataOffset() + difference);
+    if (difference < 0) {
+        header.SetDataOffset(header.GetDataOffset() + abs(difference) );
         WriteVLR(header);
     }
 

Modified: trunk/src/detail/writer12.cpp
==============================================================================
--- trunk/src/detail/writer12.cpp	(original)
+++ trunk/src/detail/writer12.cpp	Fri Jul 31 21:43:21 2009
@@ -215,8 +215,8 @@
     // it returns is the number of bytes we must increase the header
     // by in order for it to contain the VLRs.
     int32_t difference = WriteVLR(header);
-    if (difference != 0) {
-        header.SetDataOffset(header.GetDataOffset() + difference);
+    if (difference < 0) {
+        header.SetDataOffset(header.GetDataOffset() + abs(difference) );
         WriteVLR(header);
     }
 


More information about the Liblas-commits mailing list