]> Dogcows Code - chaz/tar/commitdiff
Replace strdup with xstrdup
authorSergey Poznyakoff <gray@gnu.org.ua>
Tue, 15 Feb 2005 15:24:35 +0000 (15:24 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Tue, 15 Feb 2005 15:24:35 +0000 (15:24 +0000)
src/create.c
src/names.c
src/tar.c

index d4a1b09f4d429a26ef476c6ac4f141e792e0e369..6108c439ee5d7a6f9ab113ff3942355f2ebc7394 100644 (file)
@@ -1078,7 +1078,7 @@ dump_dir0 (char *directory,
   {
     char const *entry;
     size_t entry_len;
-    char *name_buf = strdup (st->orig_file_name);
+    char *name_buf = xstrdup (st->orig_file_name);
     size_t name_size = strlen (name_buf);
     size_t name_len = name_size;
 
index c4c94de0445f53f7110eef217362dfdcb2f1a999..5f3b18b47f9cc9e753237cbb6050aa9befb32b1d 100644 (file)
@@ -66,7 +66,7 @@ uid_to_uname (uid_t uid, char **uname)
 
   if (uid != 0 && uid == cached_no_such_uid)
     {
-      *uname = strdup ("");
+      *uname = xstrdup ("");
       return;
     }
 
@@ -81,11 +81,11 @@ uid_to_uname (uid_t uid, char **uname)
       else
        {
          cached_no_such_uid = uid;
-         *uname = strdup ("");
+         *uname = xstrdup ("");
          return;
        }
     }
-  *uname = strdup (cached_uname);
+  *uname = xstrdup (cached_uname);
 }
 
 /* Given GID, find the corresponding GNAME.  */
@@ -96,7 +96,7 @@ gid_to_gname (gid_t gid, char **gname)
 
   if (gid != 0 && gid == cached_no_such_gid)
     {
-      *gname = strdup ("");
+      *gname = xstrdup ("");
       return;
     }
 
@@ -111,11 +111,11 @@ gid_to_gname (gid_t gid, char **gname)
       else
        {
          cached_no_such_gid = gid;
-         *gname = strdup ("");
+         *gname = xstrdup ("");
          return;
        }
     }
-  *gname = strdup (cached_gname);
+  *gname = xstrdup (cached_gname);
 }
 
 /* Given UNAME, set the corresponding UID and return 1, or else, return 0.  */
index 1536eed581ce21545d0b7b23c55eb5a7c6d6d8cb..1b0bf8fe071fb055f2663ca4b9361412631617f2 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -1401,7 +1401,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
              xrealloc (archive_name_array,
                        sizeof (const char *) * allocated_archive_names);
          }
-       archive_name_array[archive_names++] = strdup (buf);
+       archive_name_array[archive_names++] = xstrdup (buf);
       }
       break;
 
This page took 0.031931 seconds and 4 git commands to generate.