return fp;
}
+void
SFtextChanged()
{
if ((SFtextBuffer[0] == '/') || (SFtextBuffer[0] == '~')) {
- (void) strcpy(SFcurrentPath, SFtextBuffer);
+ (void) strncpy(SFcurrentPath, SFtextBuffer, MAXPATHLEN);
SFtextPos = XawTextGetInsertionPoint(selFileField);
} else {
- (void) strcat(strcpy(SFcurrentPath, SFstartDir), SFtextBuffer);
+ (void) strcat(strncpy(SFcurrentPath, SFstartDir, MAXPATHLEN), SFtextBuffer);
SFtextPos = XawTextGetInsertionPoint(selFileField) +
strlen(SFstartDir);
}
SFupdatePath();
+ return;
}
static char *
SFtextBuffer);
}
-static
+static void
SFprepareToReturn()
{
SFstatus = SEL_FILE_NULL;
"XsraSelFile: can't return to current directory"
);
}
+ return;
}
FILE *
XtAppError(SFapp, "XsraSelFile: can't get current directory");
}
(void) strcat(SFstartDir, "/");
- (void) strcpy(SFcurrentDir, SFstartDir);
+ (void) strncpy(SFcurrentDir, SFstartDir, MAXPATHLEN);
if (init_path) {
if (init_path[0] == '/') {
- (void) strcpy(SFcurrentPath, init_path);
+ (void) strncpy(SFcurrentPath, init_path, MAXPATHLEN);
if (strncmp(
SFcurrentPath,
SFstartDir,
SFsetText(&(SFcurrentPath[strlen(SFstartDir)]));
}
} else {
- (void) strcat(strcpy(SFcurrentPath, SFstartDir),
+ (void) strcat(strncpy(SFcurrentPath, SFstartDir, MAXPATHLEN),
init_path);
SFsetText(&(SFcurrentPath[strlen(SFstartDir)]));
}
} else {
- (void) strcpy(SFcurrentPath, SFstartDir);
+ (void) strncpy(SFcurrentPath, SFstartDir, MAXPATHLEN);
}
SFfunc = show_entry;