oops.. i changed he code around a bit then realised i simply forgot to

initialise the string to "" - thats what the problem was :)


SVN revision: 5546
This commit is contained in:
Carsten Haitzler 2001-10-21 21:53:08 +00:00
parent 9fdc2d4c99
commit 4e64c5a212
1 changed files with 30 additions and 30 deletions

View File

@ -2339,16 +2339,16 @@ ecore_window_get_command(Window win)
char *s;
int size, i;
s = NULL;
size = strlen(cargv[0]);
REALLOC(s, char, size + 1);
size = 0;
for (i = 0; i < cargc; i++)
size += strlen(cargv[i]);
size += cargc - 1;
s = NEW(char, size + 1);
s[0] = 0;
strcpy(s, cargv[0]);
for (i = 1; i < cargc; i++)
{
size += strlen(cargv[i]);
REALLOC(s, char, size + 2);
strcat(s, " ");
strcat(s, cargv[i]);
}