Use sizeof() when appropriate instead of hardcoding values (bug 14401, bug 14403)

This commit is contained in:
rim
2018-05-26 23:19:26 +02:00
committed by Landry Breuil
parent c408ee48db
commit 5e0fb6f4bc
8 changed files with 26 additions and 26 deletions

View File

@@ -158,7 +158,7 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
break;
case PROP_MEMORY:
g_strlcpy(statusbar->memory, g_value_get_string (value), 64);
g_strlcpy(statusbar->memory, g_value_get_string (value), sizeof(statusbar->memory));
text = g_strdup_printf (_("Memory: %s"), statusbar->memory);
gtk_label_set_text (GTK_LABEL (statusbar->label_memory), text);
#if GTK_CHECK_VERSION(3, 0, 0)
@@ -172,7 +172,7 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
break;
case PROP_SWAP:
g_strlcpy(statusbar->swap, g_value_get_string (value), 64);
g_strlcpy(statusbar->swap, g_value_get_string (value), sizeof(statusbar->swap));
text = g_strdup_printf (_("Swap: %s"), statusbar->swap);
gtk_label_set_text (GTK_LABEL (statusbar->label_swap), text);
g_free (text);