From ba105d6cbfec4c2323ecaff95110052fb363ac3b Mon Sep 17 00:00:00 2001 From: Son Hyunjun Date: Fri, 13 Apr 2012 02:02:13 +0900 Subject: [PATCH] [Title] modify about snprintf in getting detail info in Windows [Type] Bugfix [Module] Skin [Priority] Minor [CQ#] [Redmine#] [Problem] [Cause] [Solution] Change-Id: I84ec6dad137a8c335925fa682780067b6a1be5e2 --- tizen/src/skin/maruskin_operation.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index 52dde7e..2d64565 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -296,7 +296,7 @@ DetailInfo* get_detail_info( int qemu_argc, char** qemu_argv ) { total_len += hax_err_len; #endif - char* info_data = g_malloc0( total_len ); + char* info_data = g_malloc0( total_len + 1 ); if ( !info_data ) { g_free( detail_info ); ERR( "Fail to malloc for info data.\n" ); @@ -307,18 +307,13 @@ DetailInfo* get_detail_info( int qemu_argc, char** qemu_argv ) { total_len = 0; for ( i = 0; i < qemu_argc; i++ ) { - len = strlen( qemu_argv[i] ); - sprintf( info_data + total_len, "%s", qemu_argv[i] ); - sprintf( info_data + total_len + len, "%s", DATA_DELIMITER ); - - total_len += len; - total_len += delimiter_len; - + sprintf( info_data + total_len, "%s%s", qemu_argv[i], DATA_DELIMITER ); + total_len += len + delimiter_len; } #ifdef _WIN32 - snprintf( info_data + total_len, hax_err_len, "%s", hax_error ); + snprintf( info_data + total_len, total_len + 1, "%s", hax_error ); total_len += hax_err_len; #endif -- 2.7.4