# HG changeset patch # User Christian Urban # Date 1475941150 -3600 # Node ID d1da4bd4d7e906680c06d15497bffe47e0e577ef # Parent 97ab057cbd2e508b0bf18ad4fec22dd32140fcbc updated diff -r 97ab057cbd2e -r d1da4bd4d7e9 progs/C2b.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/progs/C2b.c Sat Oct 08 16:39:10 2016 +0100 @@ -0,0 +1,17 @@ +void welcome() { printf("Welcome!\n"); exit(0); } +void goodbye() { printf("Wrong identity, exiting!\n"); exit(1); } + +int main(){ + char name[8]; + char pw[8]; + + printf("login: "); + get_line(name); + printf("password: "); + get_line(pw); + + if(match(name, pw) == 0) + welcome(); + else + goodbye(); +}