Commit 0f0a5819 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl

Wed Dec 23 14:09:21 2009 Jiri (George) Lebl <jirka@5z.com>

	* src/graphing.c, src/util.c: fix use of strcpy
parent d9639dbd
Wed Dec 23 14:09:21 2009 Jiri (George) Lebl <jirka@5z.com>
* src/graphing.c, src/util.c: fix use of strcpy
Thu Dec 10 17:00:49 2009 Jiri (George) Lebl <jirka@5z.com>
* src/eval.c: fix matrix expansion. After zeros were replaced
......
......@@ -2736,8 +2736,11 @@ label_func (int i, GelEFunc *func, const char *var, const char *name)
if (len > 2 &&
text[0] == '(' &&
text[len-1] == ')') {
char *s;
text[len-1] = '\0';
strcpy (text, &text[1]);
s = g_strdup (&text[1]);
g_free (text);
text = s;
len-=2;
}
......
......@@ -46,12 +46,11 @@ gel_appendstr (char *s,const char *p)
{
if (p == NULL || *p == '\0')
return s;
if (s) {
if (s != NULL) {
s = g_realloc (s, strlen(s)+strlen(p)+1);
strcat(s,p);
} else {
s=(char*)g_malloc(strlen(p)+1);
strcpy(s,p);
s = g_strdup (p);
}
return s;
}
......@@ -63,16 +62,14 @@ gel_prependstr(char *s,const char *p)
char *p2;
if (p == NULL || *p == '\0')
return s;
if(s) {
if (s != NULL) {
p2=(char *)g_malloc(strlen(s)+strlen(p)+1);
strcpy(p2,p);
strcat(p2,s);
g_free(s);
return p2;
}
s=(char*)g_malloc(strlen(p)+1);
strcpy(s,p);
return s;
return g_strdup (p);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment