Skip to content
Snippets Groups Projects
Commit f38425f0 authored by Nick Schermer's avatar Nick Schermer
Browse files

* Cut string to MenuCharacters*8, this could same some size

  and time when *huge* amounts of data are copied.


(Old svn revision: 1854)
parent dd5d27ab
No related branches found
No related tags found
No related merge requests found
......@@ -112,11 +112,12 @@ clipman_check_array_len (ClipmanPlugin *clipman)
}
static gchar *
clipman_create_title (gchar *txt)
clipman_create_title (gchar *txt,
gint length)
{
gchar *s, *t, *u;
s = g_strdup (txt);
s = g_strndup (txt, length*8);
if (!g_utf8_validate (s, -1, NULL))
{
......@@ -177,7 +178,8 @@ clipman_add_clip (ClipmanPlugin *clipman,
{
new_clip = g_new0 (ClipmanClip, 1);
new_clip->title = clipman_create_title (txt);
new_clip->title = clipman_create_title (txt,
clipman->MenuCharacters);
/* No valid title could be created, drop it... */
if (new_clip->title == NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment