re PR other/67652 (liboffloadmic/runtime/offload_engine.cpp:176: strange expression...
authorIlya Verbin <ilya.verbin@intel.com>
Mon, 28 Sep 2015 16:10:16 +0000 (16:10 +0000)
committerIlya Verbin <iverbin@gcc.gnu.org>
Mon, 28 Sep 2015 16:10:16 +0000 (16:10 +0000)
PR other/67652
liboffloadmic/
* runtime/offload_engine.cpp (Engine::init_process): Fix sizeof.

From-SVN: r228210

liboffloadmic/ChangeLog
liboffloadmic/runtime/offload_engine.cpp

index 4a726c8636d8dcb30f42af79805f22a511b71596..130026dd04105c34dce31922ebe02ef11380e91e 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-28  Ilya Verbin  <ilya.verbin@intel.com>
+
+       PR other/67652
+       * runtime/offload_engine.cpp (Engine::init_process): Fix sizeof.
+
 2015-09-08  Ilya Verbin  <ilya.verbin@intel.com>
 
        * Makefile.am (liboffloadmic_host_la_DEPENDENCIES): Remove libcoi_host
index 16b440d7ab614073a6eaaf90d59bd80fce1e2ddb..00b673aebcb1777b4e632b920229dece862518bc 100644 (file)
@@ -173,7 +173,7 @@ void Engine::init_process(void)
             // use putenv instead of setenv as Windows has no setenv.
             // Note: putenv requires its argument can't be freed or modified.
             // So no free after call to putenv or elsewhere.
-            char * env_var = (char*) malloc(sizeof("COI_DMA_CHANNEL_COUNT=2" + 1));
+            char * env_var = (char*) malloc(sizeof("COI_DMA_CHANNEL_COUNT=2"));
             sprintf(env_var, "COI_DMA_CHANNEL_COUNT=2");
             putenv(env_var);  
         }