[project @ 2004-03-28 15:21:49 by jmb]

Fixup truncation of sprite name.
Use malloc instead of calloc

svn path=/import/netsurf/; revision=687
This commit is contained in:
John Mark Bell 2004-03-28 15:21:49 +00:00
parent 9c4dad6b63
commit 4b6e8a9a27

View File

@ -186,7 +186,7 @@ void ro_gui_save_datasave_ack(wimp_message *message)
void ro_gui_save_complete(struct content *c, char *path) void ro_gui_save_complete(struct content *c, char *path)
{ {
char buf[256], spritename[12]; char buf[256], spritename[13];
FILE *fp; FILE *fp;
os_error *error; os_error *error;
osspriteop_area *area; osspriteop_area *area;
@ -228,9 +228,9 @@ void ro_gui_save_complete(struct content *c, char *path)
return; return;
} }
snprintf(spritename, sizeof spritename, "%s", appname+1); snprintf(spritename, sizeof spritename, "%s", appname+1);
area = xcalloc(SPRITE_SIZE, sizeof(char)); area = malloc(SPRITE_SIZE);
if (!area) { if (!area) {
LOG(("xcalloc failed")); LOG(("malloc failed"));
warn_user("No memory for sprite"); warn_user("No memory for sprite");
return; return;
} }
@ -244,7 +244,7 @@ void ro_gui_save_complete(struct content *c, char *path)
if (error) { if (error) {
LOG(("Failed to create sprite")); LOG(("Failed to create sprite"));
warn_user("Failed to create iconsprite"); warn_user("Failed to create iconsprite");
xfree(area); free(area);
return; return;
} }
thumbnail_create(c, area, thumbnail_create(c, area,
@ -254,11 +254,11 @@ void ro_gui_save_complete(struct content *c, char *path)
if (error) { if (error) {
LOG(("Failed to save iconsprite")); LOG(("Failed to save iconsprite"));
warn_user("Failed to save iconsprite"); warn_user("Failed to save iconsprite");
xfree(area); free(area);
return; return;
} }
xfree(area); free(area);
/* Create !Boot file */ /* Create !Boot file */
snprintf(buf, sizeof buf, "%s.!Boot", path); snprintf(buf, sizeof buf, "%s.!Boot", path);