Don't use gets(). As it liked to tell me, it's unsafe.

This commit is contained in:
Steve Checkoway
2003-09-30 17:24:29 +00:00
parent 3914243e15
commit 4b59491a9e
@@ -57,7 +57,12 @@ const CString GetPath(const CString& ID)
printf("Enter a path (relative or absolute) to the install files\n"
"The current working directory is: %s\n"
"> ", cwd);
ptr = gets(path);
ptr = fgets(path, path, stdin);
if ((size_t temp = strlen(path)))
{
if (path[temp - 1] == '\n')
path[temp - -1] = '\000';
}
ASSERT(ptr);
while (*ptr != '\000' && (*ptr == ' ' || *ptr == '\t'))
++ptr;