Print this page
5218 posix definition of NULL
correct unistd.h and iso/stddef_iso.h
update gate source affected

@@ -2644,11 +2644,11 @@
  */
 static int
 convtoreg(off_t size)
 {
         if ((size > 0) && (dblock.dbuf.typeflag != '0') &&
-            (dblock.dbuf.typeflag != NULL) && (dblock.dbuf.typeflag != '1') &&
+            (dblock.dbuf.typeflag != '\0') && (dblock.dbuf.typeflag != '1') &&
             (dblock.dbuf.typeflag != '2') && (dblock.dbuf.typeflag != '3') &&
             (dblock.dbuf.typeflag != '4') && (dblock.dbuf.typeflag != '5') &&
             (dblock.dbuf.typeflag != '6') && (dblock.dbuf.typeflag != 'A') &&
             (dblock.dbuf.typeflag != 'L') &&
             (dblock.dbuf.typeflag != _XATTR_HDRTYPE) &&

@@ -3157,11 +3157,11 @@
                         if (rmdir(namep) < 0) {
                                 if (errno == ENOTDIR)
                                         (void) unlink(namep);
                         }
                         linkp = templink;
-                        if (*linkp !=  NULL) {
+                        if (*linkp !=  '\0') {
                                 if (Aflag && *linkp == '/')
                                         linkp++;
                                 if (link(linkp, namep) < 0) {
                                         (void) fprintf(stderr, gettext(
                                             "tar: %s: cannot link\n"), namep);

@@ -3198,11 +3198,11 @@
                         if (rmdir(namep) < 0) {
                                 if (errno == ENOTDIR)
                                         (void) unlink(namep);
                         }
                         linkp = templink;
-                        if (*linkp != NULL) {
+                        if (*linkp != '\0') {
                                 if (Aflag && *linkp == '/')
                                         linkp++;
                                 if (link(linkp, namep) < 0) {
                                         (void) fprintf(stderr, gettext(
                                             "tar: %s: cannot link\n"), namep);

@@ -3247,11 +3247,11 @@
                         if (rmdir(namep) < 0) {
                                 if (errno == ENOTDIR)
                                         (void) unlink(namep);
                         }
                         linkp = templink;
-                        if (*linkp != NULL) {
+                        if (*linkp != '\0') {
                                 if (Aflag && *linkp == '/')
                                         linkp++;
                                 if (link(linkp, namep) < 0) {
                                         (void) fprintf(stderr, gettext(
                                             "tar: %s: cannot link\n"), namep);

@@ -3387,14 +3387,14 @@
                                     dblock.dbuf.typeflag);
                                 Errflg = 1;
                         }
                 }
                 if (dblock.dbuf.typeflag == '0' ||
-                    dblock.dbuf.typeflag == NULL || convflag) {
+                    dblock.dbuf.typeflag == '\0' || convflag) {
                         delete_target(dirfd, comp, namep);
                         linkp = templink;
-                        if (*linkp != NULL) {
+                        if (*linkp != '\0') {
                                 if (Aflag && *linkp == '/')
                                         linkp++;
                                 if (link(linkp, comp) < 0) {
                                         (void) fprintf(stderr, gettext(
                                             "tar: %s: cannot link\n"), namep);

@@ -3596,11 +3596,11 @@
                         /* set file ownership */
                         resugname(dirfd, comp, symflag);
 
                 if (pflag && newfile == TRUE && !dir &&
                     (dblock.dbuf.typeflag == '0' ||
-                    dblock.dbuf.typeflag == NULL ||
+                    dblock.dbuf.typeflag == '\0' ||
                     convflag || dblock.dbuf.typeflag == '1')) {
                         if (fstat(ofile, &xtractbuf) == -1)
                                 (void) fprintf(stderr, gettext(
                                     "tar: cannot stat extracted file "
                                     "%s%s%s%s\n"),

@@ -5483,11 +5483,11 @@
         unsigned int h;
         file_list_t     *exp;
 
         (void) strcpy(name, str);
         while (name[strlen(name) - 1] == '/') {
-                name[strlen(name) - 1] = NULL;
+                name[strlen(name) - 1] = '\0';
         }
 
         h = hash(name);
         if ((exp = (file_list_t *)calloc(sizeof (file_list_t),
             sizeof (char))) == NULL) {

@@ -5521,11 +5521,11 @@
         file_list_t     *exp;
         char    *ptr;
 
         (void) strcpy(name, str);
         while (name[strlen(name) - 1] == '/') {
-                name[strlen(name) - 1] = NULL;
+                name[strlen(name) - 1] = '\0';
         }
 
         /*
          * check for the file name in the passed list
          */

@@ -5540,11 +5540,11 @@
 
         /*
          * check for any parent directories in the file list
          */
         while ((ptr = strrchr(name, '/'))) {
-                *ptr = NULL;
+                *ptr = '\0';
                 h = hash(name);
                 exp = table[h];
                 while (exp != NULL) {
                         if (strcmp(name, exp->name) == 0) {
                                 return (1);

@@ -6613,11 +6613,11 @@
                         if (!lstat(namep, &xtractbuf)) {
                                 if ((xtractbuf.st_mode & S_IFMT) != S_IFLNK) {
                                         (void) unlinkat(fd, comp, 0);
                                 } else if ((n = readlink(namep, buf,
                                     PATH_MAX)) != -1) {
-                                        buf[n] = (char)NULL;
+                                        buf[n] = '\0';
                                         (void) unlinkat(fd, buf,
                                             AT_REMOVEDIR);
                                         if (errno == ENOTDIR)
                                                 (void) unlinkat(fd, buf, 0);
                                 } else {