shithub: riscv

ref: 8a4a2dea70aa77475a50968f4c5bd6cdab5d2fb1
dir: /sys/src/cmd/auth/lib/answer.c/

View raw version
#include <u.h>
#include <libc.h>
#include <bio.h>
#include <authsrv.h>
#include "authcmdlib.h"

int
answer(char *q)
{
	char pr[128];
	int y;

	snprint(pr, sizeof(pr), "%s [y/n]", q);
	q = readcons(pr, nil, 0);
	y = q != nil && (*q == 'y' || *q == 'Y');
	free(q);
	return y;
}