aboutsummaryrefslogtreecommitdiffstats
path: root/mpi
diff options
context:
space:
mode:
Diffstat (limited to 'mpi')
-rw-r--r--mpi/ChangeLog5
-rw-r--r--mpi/mpicoder.c15
2 files changed, 14 insertions, 6 deletions
diff --git a/mpi/ChangeLog b/mpi/ChangeLog
index e2e27c8cf..f540fac2e 100644
--- a/mpi/ChangeLog
+++ b/mpi/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-13 Werner Koch <[email protected]>
+
+ * mpicoder.c (do_get_buffer): Don't remove leading zeros if the
+ MPI is marked as protected.
+
2002-08-02 Timo Schulz <[email protected]>
* mpicoder.c: Add a '\n' to all log_bug functions.
diff --git a/mpi/mpicoder.c b/mpi/mpicoder.c
index e0434c15f..559facd89 100644
--- a/mpi/mpicoder.c
+++ b/mpi/mpicoder.c
@@ -363,12 +363,15 @@ do_get_buffer( MPI a, unsigned *nbytes, int *sign, int force_secure )
#endif
}
- /* this is sub-optimal but we need to do the shift oepration because
- * the caller has to free the returned buffer */
- for(p=buffer; !*p && *nbytes; p++, --*nbytes )
- ;
- if( p != buffer )
- memmove(buffer,p, *nbytes);
+ if (!mpi_is_protected (a))
+ {
+ /* this is sub-optimal but we need to do the shift operation
+ * because the caller has to free the returned buffer */
+ for(p=buffer; !*p && *nbytes; p++, --*nbytes )
+ ;
+ if( p != buffer )
+ memmove(buffer,p, *nbytes);
+ }
return buffer;
}