hilodirect PoC: unite error paths

pull/1349/head
nick black 4 years ago
parent 815368c9a7
commit 9dd710d1e6
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -12,12 +12,11 @@ int main(void){
do{ do{
if(!(r |= (ncdirect_set_fg_default(n)))){ if(!(r |= (ncdirect_set_fg_default(n)))){
if(!(r |= (printf("Guess the long: ") < 0))){ if(!(r |= (printf("Guess the long: ") < 0))){
if(!fflush(stdout)){ if(!(r |= fflush(stdout))){
int rargs = scanf("%ld", &guess); // super shitty to the max int rargs = scanf("%ld", &guess); // super shitty to the max
if(rargs != 1){ if(rargs != 1){
fprintf(stderr, "Die, infidel!\n"); r = -1;
ncdirect_stop(n); break;
return EXIT_FAILURE;
} }
int offoom = labs(__builtin_clzl(guess) - __builtin_clzl(secret)); int offoom = labs(__builtin_clzl(guess) - __builtin_clzl(secret));
if(guess > secret){ if(guess > secret){
@ -30,7 +29,7 @@ int main(void){
} }
} }
} }
}while(guess != secret && !r); }while(!r && guess != secret);
if(r || printf("You enjoy 20/20 vision into the minds of antimen!\n") < 0){ if(r || printf("You enjoy 20/20 vision into the minds of antimen!\n") < 0){
ncdirect_stop(n); ncdirect_stop(n);
return EXIT_FAILURE; return EXIT_FAILURE;

Loading…
Cancel
Save