X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftrace.c;h=0e50ae550707597de0aee029b8dc9cdda3829405;hb=d96de323da8d7d9561ecbb5c2ebcdeb23ee1ee2e;hp=90f0af81b5a2c2e606f9e4b2d7be094f7be8d357;hpb=fe1f6c80bea4338a0f2d0b6974160194324b7d78;p=mono.git diff --git a/mono/mini/trace.c b/mono/mini/trace.c index 90f0af81b5a..0e50ae55070 100644 --- a/mono/mini/trace.c +++ b/mono/mini/trace.c @@ -1,5 +1,6 @@ -/* - * trace.c: Tracing facilities for the Mono Runtime. +/** + * \file + * Tracing facilities for the Mono Runtime. * * Author: * Paolo Molaro (lupus@ximian.com) @@ -25,7 +26,7 @@ #include #include "trace.h" -#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS)) +#if defined (HOST_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS)) # undef printf # define printf(...) g_log("mono", G_LOG_LEVEL_MESSAGE, __VA_ARGS__) # undef fprintf @@ -166,9 +167,10 @@ static void get_string (void) } if (value != NULL) g_free (value); - value = (char *)g_malloc (input - start + 1); - strncpy (value, start, input-start); - value [input-start] = 0; + size_t len = input - start; + value = (char *)g_malloc (len + 1); + memcpy (value, start, len); + value [len] = 0; } enum Token {