From 085fb428b8bf8c94a571d105e8c95075f024d5ce Mon Sep 17 00:00:00 2001 From: Igor Mitsyanko Date: Thu, 8 Nov 2012 18:37:34 +0400 Subject: [PATCH] yagl-log: use g_strndup because there is no strdup in mingw Signed-off-by: Igor Mitsyanko --- hw/yagl_log.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/yagl_log.c b/hw/yagl_log.c index 2ad0ca2..e9bf304 100644 --- a/hw/yagl_log.c +++ b/hw/yagl_log.c @@ -261,13 +261,13 @@ void yagl_log_init(void) { if ((tmp - tmp_facilities - 1) > 0) { - g_log_facilities_no_match[num_no_match] = strndup(tmp_facilities + 1, tmp - tmp_facilities - 1); + g_log_facilities_no_match[num_no_match] = g_strndup(tmp_facilities + 1, tmp - tmp_facilities - 1); ++num_no_match; } } else { - g_log_facilities_match[num_match] = strndup(tmp_facilities, tmp - tmp_facilities); + g_log_facilities_match[num_match] = g_strndup(tmp_facilities, tmp - tmp_facilities); ++num_match; } } @@ -281,13 +281,13 @@ void yagl_log_init(void) { if ((strlen(tmp_facilities) - 1) > 0) { - g_log_facilities_no_match[num_no_match] = strdup(tmp_facilities + 1); + g_log_facilities_no_match[num_no_match] = g_strdup(tmp_facilities + 1); ++num_no_match; } } else { - g_log_facilities_match[num_match] = strdup(tmp_facilities); + g_log_facilities_match[num_match] = g_strdup(tmp_facilities); ++num_match; } } @@ -321,7 +321,7 @@ void yagl_log_cleanup(void) { for (i = 0; g_log_facilities_no_match[i]; ++i) { - free(g_log_facilities_no_match[i]); + g_free(g_log_facilities_no_match[i]); g_log_facilities_no_match[i] = NULL; } g_free(g_log_facilities_no_match); @@ -331,7 +331,7 @@ void yagl_log_cleanup(void) { for (i = 0; g_log_facilities_match[i]; ++i) { - free(g_log_facilities_match[i]); + g_free(g_log_facilities_match[i]); g_log_facilities_match[i] = NULL; } g_free(g_log_facilities_match); -- 2.7.4