Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics from patch review
[simgrid.git] / src / xbt / ex.c
index a0127e5..e641a18 100644 (file)
 
 #include "simgrid/simix.h" /* SIMIX_process_self_get_name() */
 
-#undef HAVE_BACKTRACE
-#if HAVE_EXECINFO_H && HAVE_POPEN && defined(ADDR2LINE)
-# define HAVE_BACKTRACE 1       /* Hello linux box */
-#endif
-
-#if defined(_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
-# define HAVE_BACKTRACE 1       /* Hello x86 windows box */
-#endif
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ex, xbt, "Exception mecanism");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ex, xbt, "Exception mechanism");
 
 XBT_EXPORT_NO_IMPORT(const xbt_running_ctx_t) __xbt_ex_ctx_initializer = XBT_RUNNING_CTX_INITIALIZER;
 
@@ -119,7 +110,7 @@ void xbt_backtrace_display_current(void)
   xbt_backtrace_display(&e);
 }
 
-#if HAVE_EXECINFO_H && HAVE_POPEN && defined(ADDR2LINE)
+#if HAVE_BACKTRACE && HAVE_EXECINFO_H && HAVE_POPEN && defined(ADDR2LINE)
 # include "src/xbt/backtrace_linux.c"
 #else
 # include "src/xbt/backtrace_dummy.c"
@@ -402,8 +393,8 @@ static void good_example(void)
       cp1 = NULL /*05 give away */ ;
       cp2 = mallocex(TOOBIG);
       cp3 = mallocex(SMALLAMOUNT);
-      strcpy(cp1, "foo");
-      strcpy(cp2, "bar");
+      strncpy(cp1, "foo",3);
+      strncpy(cp2, "bar",3);
     }
     TRY_CLEANUP {               /*04 */
       printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);