]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Some of these were overwriting their argument with a pascal
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 18 Jan 1995 13:55:41 +0000 (13:55 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 18 Jan 1995 13:55:41 +0000 (13:55 +0000)
string. Use own Pstring() routine (which uses a static buffer) everywhere.

Mac/Compat/chdir.c
Mac/Compat/macstat.c
Mac/Compat/mkdir.c
Mac/Compat/rmdir.c

index b8ec6d7e51b8e1fd6e0df4573189ae015b7f6021..3f89b5255d95ddc809a460047b3525b805d35698 100644 (file)
@@ -11,11 +11,8 @@ chdir(path)
        char *path;
 {
        WDPBRec pb;
-       char name[MAXPATH];
        
-       strncpy(name, path, sizeof name);
-       name[MAXPATH-1]= EOS;
-       pb.ioNamePtr= (StringPtr) c2pstr(name);
+       pb.ioNamePtr= (StringPtr) Pstring(path);
        pb.ioVRefNum= 0;
        pb.ioWDDirID= 0;
        if (PBHSetVol(&pb, FALSE) != noErr) {
index 564da1030f8da949b329df6d3766584f6d41ccab..0f690e098cb3c91ca7d9bccefaec97374af8436c 100644 (file)
@@ -21,10 +21,9 @@ macstat(path, buf)
                FileParam f;
                HFileInfo hf;
        } pb;
-       char name[256];
        short err;
        
-       pb.d.ioNamePtr = (unsigned char *)c2pstr(strcpy(name, path));
+       pb.d.ioNamePtr = (unsigned char *)Pstring(path);
        pb.d.ioVRefNum = 0;
        pb.d.ioFDirIndex = 0;
        pb.d.ioDrDirID = 0;
index b0647610a5875265f121d6d98390375ebefd9627..3c35eb0ca88c86862aeea073c78d078743a174f3 100644 (file)
@@ -12,14 +12,12 @@ mkdir(path, mode)
        int mode; /* Ignored */
 {
        HFileParam pb;
-       char name[MAXPATH];
                
        if (!hfsrunning()) {
                errno= ENODEV;
                return -1;
        }
-       strncpy(name, path, sizeof name);
-       pb.ioNamePtr= (StringPtr) c2pstr(name);
+       pb.ioNamePtr= (StringPtr) Pstring(path);
        pb.ioVRefNum= 0;
        pb.ioDirID= 0;
        if (PBDirCreate((HParmBlkPtr)&pb, FALSE) != noErr) {
index f31052f8c46b2b46cfd40232a48f68054012357d..2e406c280cc06f091345d8b4b03b27dad51dcc41 100644 (file)
@@ -9,10 +9,8 @@ rmdir(path)
        char *path;
 {
        IOParam pb;
-       char name[MAXPATH];
        
-       strncpy(name, path, sizeof name);
-       pb.ioNamePtr= (StringPtr) c2pstr(name);
+       pb.ioNamePtr= (StringPtr) Pstring(path);
        pb.ioVRefNum= 0;
        if (PBDelete((ParmBlkPtr)&pb, FALSE) != noErr) {
                errno= EACCES;