Author: dcoakley
Date: 2010-09-24 16:18:18 -0400 (Fri, 24 Sep 2010)
New Revision: 3361

Modified:
   trunk/osprey/common/util/flags.c
Log:
Fix incorrect assignments for flag values.

Since the values are binary data, use memmove instead of strncpy.

Approved by: Mike Murphy


Modified: trunk/osprey/common/util/flags.c
===================================================================
--- trunk/osprey/common/util/flags.c    2010-09-24 01:34:47 UTC (rev 3360)
+++ trunk/osprey/common/util/flags.c    2010-09-24 20:18:18 UTC (rev 3361)
@@ -377,7 +377,7 @@
   OPTVALTYPES v;
 
   if (Get_OVK_Size(o) > 0)
-    strncpy((void *) &v, p, Get_OVK_Size(o));
+    memmove(&v, p, Get_OVK_Size(o));
 
   switch (o) {
     case OVK_NONE:
@@ -405,7 +405,7 @@
 {
   OPTVALTYPES v;
   if (OVK_Pointer_Kind(o)) {
-    strncpy((void *) &v, p, Get_OVK_Size(o));
+    memmove(&v, p, Get_OVK_Size(o));
     return (void *) v.p;
   }
   else
@@ -428,9 +428,9 @@
 
   if (size > 0) {
     if (save)
-      strncpy(container, var, size);
+      memmove(container, var, size);
     else /* restore */
-      strncpy(var, container, size);
+      memmove(var, container, size);
   }
 
   return size;
@@ -676,7 +676,7 @@
       break;
   }
   if (Get_OVK_Size(ODESC_kind(odesc)) > 0) 
-    strncpy(var, (void *) &v, Get_OVK_Size(ODESC_kind(odesc)));
+    memmove(var, &v, Get_OVK_Size(ODESC_kind(odesc)));
 }
 
 /* ====================================================================


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to