aboutsummaryrefslogtreecommitdiff
path: root/libid3tag
diff options
context:
space:
mode:
Diffstat (limited to 'libid3tag')
-rw-r--r--libid3tag/file.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libid3tag/file.c b/libid3tag/file.c
index 5ad025b..9210571 100644
--- a/libid3tag/file.c
+++ b/libid3tag/file.c
@@ -704,17 +704,17 @@ int v2_write(struct id3_file *file,
if (!tmp)
return -1;
- rc = copy_block(file->iofile, tmp, 0, file->tags[0].location);
- if (rc == 0) {
- if (data && length)
- rc = fwrite(data, length, 1, tmp) != 1;
- else
- rc = 0;
+ if (data && length)
+ rc = fwrite(data, length, 1, tmp) != 1;
+ else
+ rc = 0;
- if (rc == 0)
- rc = copy_block(file->iofile, tmp,
- file->tags[0].location + file->tags[0].length, -1);
- }
+ if (rc == 0)
+ rc = copy_block(file->iofile, tmp,
+ /* FIXME: Should I check tag->version instead? */
+ (file->tags[0].location == 0) ?
+ file->tags[0].length : 0, -1);
+
fclose(tmp);
if (rc)
unlink(tmpname);

Return to:

Send suggestions and report system problems to the System administrator.