Skip to content

Commit 8d7eafa

Browse files
committed
Fix Dangerous use of 'cin' code scanning alerts
1 parent e1739aa commit 8d7eafa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/stilview.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ void checkArguments(void)
259259
{
260260
hvscLoc = new char[STIL_MAX_PATH_SIZE];
261261
cout << "Enter HVSC base directory: ";
262+
cin.width(STIL_MAX_PATH_SIZE);
262263
cin >> hvscLoc;
263264
}
264265
else
@@ -620,6 +621,7 @@ int main(int argc, char **argv)
620621
{
621622
cout << "Enter desired entry (relative path) or 'q' to exit." << endl;
622623
cout << "Entry: ";
624+
cin.width(STIL_MAX_PATH_SIZE);
623625
cin >> temp;
624626

625627
if (*temp == '/')

0 commit comments

Comments
 (0)