[gthumb/gthumb-2-14] removed useless and potentially dangerous strncpy



commit 35eb9fee07bcc220db39336e4336352a87b0bfd6
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Mar 26 20:36:13 2012 +0200

    removed useless and potentially dangerous strncpy
    
    [bug #672866]

 gthumb/gth-file-properties.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/gthumb/gth-file-properties.c b/gthumb/gth-file-properties.c
index 06c591c..8ba65b2 100644
--- a/gthumb/gth-file-properties.c
+++ b/gthumb/gth-file-properties.c
@@ -126,11 +126,8 @@ gth_file_properties_real_set_file (GthPropertyView *base,
 		if (value != NULL) {
 			char *tmp_value;
 
-			if (g_utf8_strlen (value, -1) > MAX_ATTRIBUTE_LENGTH) {
-				g_utf8_strncpy (value, value, MAX_ATTRIBUTE_LENGTH - 3);
+			if (g_utf8_strlen (value, -1) > MAX_ATTRIBUTE_LENGTH)
 				g_utf8_strncpy (g_utf8_offset_to_pointer (value, MAX_ATTRIBUTE_LENGTH - 3), "...", 3);
-			}
-
 			tmp_value = _g_utf8_replace (value, "[\r\n]", " ");
 			g_free (value);
 			value = tmp_value;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]