formattign and allocs...

SVN revision: 30925
This commit is contained in:
Carsten Haitzler 2007-07-21 05:06:39 +00:00
parent be1ba8873b
commit 902b6c40bb
2 changed files with 12 additions and 8 deletions

View File

@ -700,7 +700,12 @@ data_write(void)
data = malloc(size);
if (data)
{
fread(data, size, 1, f);
if (fread(data, size, 1, f) != 1)
{
fprintf(stderr, "%s: Error. unable to read all of script object \"%s\"\n",
progname, tmpo);
ABORT_WRITE(ef, file_out);
}
snprintf(buf, sizeof(buf), "scripts/%i", i);
bt = eet_write(ef, buf, data, size, 1);
free(data);
@ -1084,12 +1089,12 @@ data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void
{
/* concat strings like "foo""bar" to "foobar" */
if (*(pp + 1) == '\"')
pp++;
pp++;
else
{
name[i] = 0;
break;
}
{
name[i] = 0;
break;
}
}
else
{

View File

@ -212,7 +212,7 @@ next_token(char *p, char *end, char **new_p, int *delim)
pp++;
}
l = pp - p;
tmpstr = malloc(l + 1);
tmpstr = alloca(l + 1);
if (!tmpstr)
{
fprintf(stderr, "%s: Error. %s:%i malloc %i bytes failed\n",
@ -228,7 +228,6 @@ next_token(char *p, char *end, char **new_p, int *delim)
line = nm;
file_in = file_buf;
}
free(tmpstr);
}
else if ((!in_comment_ss) && (!in_comment_sa) && (!in_comment_cpp))
{