tst: launcher-secrets: secret: replace gets with fgets

This commit is contained in:
Bill Zissimopoulos 2024-06-03 11:49:38 +01:00
parent 507c794470
commit b058925692

View File

@ -16,7 +16,14 @@ int main()
{ {
char pass[256]; char pass[256];
gets(pass); fgets(pass, sizeof pass, stdin);
for (char *p = pass; *p; p++)
if ('\n' == *p)
{
*p = '\0';
break;
}
if (0 == strcmp("foobar", pass)) if (0 == strcmp("foobar", pass))
{ {
puts("OK"); puts("OK");