BSD 3 development
[unix-history] / usr / src / cmd / pwd.c
index b060709..c0dcd8d 100644 (file)
@@ -8,7 +8,7 @@
 
 char   dot[]   = ".";
 char   dotdot[] = "..";
 
 char   dot[]   = ".";
 char   dotdot[] = "..";
-char   name[512];
+char   name[BUFSIZ];
 int    file;
 int    off     = -1;
 struct stat    d, dd;
 int    file;
 int    off     = -1;
 struct stat    d, dd;
@@ -69,7 +69,7 @@ cat()
 
        i = -1;
        while (dir.d_name[++i] != 0);
 
        i = -1;
        while (dir.d_name[++i] != 0);
-       if ((off+i+2) > 511)
+       if ((off+i+2) > BUFSIZ-1)
                prname();
        for(j=off+1; j>=0; --j)
                name[j+i+1] = name[j];
                prname();
        for(j=off+1; j>=0; --j)
                name[j+i+1] = name[j];