]> Dogcows Code - chaz/tar/blobdiff - src/xheader.c
build: new configure option --enable-gcc-warnings
[chaz/tar] / src / xheader.c
index d68aa2e0cef7f087551f30a4ca9f235d232185f3..291d9950dd3737325326ce73af26cfc7004267aa 100644 (file)
@@ -262,7 +262,7 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
   char *dir = NULL;
   char *base = NULL;
   char pidbuf[UINTMAX_STRSIZE_BOUND];
-  char const *pptr;
+  char const *pptr = NULL;
   char nbuf[UINTMAX_STRSIZE_BOUND];
   char const *nptr = NULL;
 
@@ -335,13 +335,10 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
              break;
 
            case 'n':
-             if (nptr)
-               {
-                 q = stpcpy (q, nptr);
-                 p += 2;
-                 break;
-               }
-             /* else fall through */
+             q = stpcpy (q, nptr);
+             p += 2;
+             break;
+
 
            default:
              *q++ = *p++;
@@ -460,7 +457,8 @@ xheader_write_global (struct xheader *xhdr)
     }
 }
 
-void xheader_xattr_init (struct tar_stat_info *st)
+void
+xheader_xattr_init (struct tar_stat_info *st)
 {
   st->xattr_map = NULL;
   st->xattr_map_size = 0;
@@ -472,7 +470,8 @@ void xheader_xattr_init (struct tar_stat_info *st)
   st->cntx_name = NULL;
 }
 
-void xheader_xattr_free (struct xattr_array *xattr_map, size_t xattr_map_size)
+void
+xheader_xattr_free (struct xattr_array *xattr_map, size_t xattr_map_size)
 {
   size_t scan = 0;
 
@@ -486,9 +485,10 @@ void xheader_xattr_free (struct xattr_array *xattr_map, size_t xattr_map_size)
   free (xattr_map);
 }
 
-static void xheader_xattr__add (struct xattr_array **xattr_map,
-                                size_t *xattr_map_size,
-                                const char *key, const char *val, size_t len)
+static void
+xheader_xattr__add (struct xattr_array **xattr_map,
+                   size_t *xattr_map_size,
+                   const char *key, const char *val, size_t len)
 {
   size_t pos = (*xattr_map_size)++;
 
@@ -537,8 +537,9 @@ xattr_decode_keyword (char *keyword)
     }
 }
 
-void xheader_xattr_add(struct tar_stat_info *st,
-                       const char *key, const char *val, size_t len)
+void
+xheader_xattr_add (struct tar_stat_info *st,
+                  const char *key, const char *val, size_t len)
 {
   size_t klen = strlen (key);
   char *xkey = xmalloc (strlen("SCHILY.xattr.") + klen + 1);
@@ -552,8 +553,9 @@ void xheader_xattr_add(struct tar_stat_info *st,
   free (xkey);
 }
 
-void xheader_xattr_copy(const struct tar_stat_info *st,
-                        struct xattr_array **xattr_map, size_t *xattr_map_size)
+void
+xheader_xattr_copy (const struct tar_stat_info *st,
+                   struct xattr_array **xattr_map, size_t *xattr_map_size)
 {
   size_t scan = 0;
 
@@ -1182,8 +1184,6 @@ decode_time (struct timespec *ts, char const *arg, char const *keyword)
   return true;
 }
 
-
-
 static void
 code_num (uintmax_t value, char const *keyword, struct xheader *xhdr)
 {
This page took 0.025076 seconds and 4 git commands to generate.