aboutsummaryrefslogtreecommitdiff
blob: 261a58ef88d574bc20e143c836f88d879eaf48fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include <string.h>

int main(void)
{
	char buf[16];
	int ok = 0;

	printf("Type admin password: ");
	fgets(buf, sizeof buf, stdin);
	buf[strlen(buf)-1] = '\0';

	if (strcmp(buf, "pass123")) printf("\nWrong password!\n");
	else ok = 1;

	if (ok) printf("\nLogged in as admin.\n");

	return 0;
}