tmpfile[0] = 0;
tmp[0] = 0;
- strncat(tmpfile, image->image_filename, sizeof(tmpfile) - 1);
- strncat(tmpfile, ".tmp", sizeof(tmpfile) - 1);
+ strncpy(tmpfile, image->image_filename, sizeof(tmpfile) - 1);
+ strncat(tmpfile, ".tmp",
+ sizeof(tmpfile) - strlen(image->image_filename) - 1);
if (image->updatestr)
updatestr = image->updatestr;