@matheusbsbs / matheus-bagliano / commits / 326711c168
Fork 0

Use xstrdup instead of strdup in builtin-{tar,zip}-tree.c

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 5d2aea4cb383a43e40d47ab69d8ad7a495df6ea2 commit)

Rene Scharfe committed Sep 10, 2006 at 18:10 UTC 326711c16879792da8d7159bf29d080569c3a1e0
2 files changed +2 -2
builtin-tar-tree.c
+1 -1
@@ -390,7 +390,7 @@ int write_tar_archive(struct archiver_args *args)
390 write_global_extended_header(args->commit_sha1);
391
392 if (args->base && plen > 0 && args->base[plen - 1] == '/') {
393 - char *base = strdup(args->base);
393 + char *base = xstrdup(args->base);
394 int baselen = strlen(base);
395
396 while (baselen > 0 && base[baselen - 1] == '/')
builtin-zip-tree.c
+1 -1
@@ -363,7 +363,7 @@ int write_zip_archive(struct archiver_args *args)
363 zip_dir_size = ZIP_DIRECTORY_MIN_SIZE;
364
365 if (args->base && plen > 0 && args->base[plen - 1] == '/') {
366 - char *base = strdup(args->base);
366 + char *base = xstrdup(args->base);
367 int baselen = strlen(base);
368
369 while (baselen > 0 && base[baselen - 1] == '/')