[ create a new paste ] login | about

Link: http://codepad.org/FEddJU4f    [ raw code | fork ]

C, pasted on Sep 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "getpassword.h"
#include <stdio.h>

int main()
{
	unsigned sz = 4096;
	char* buffer = malloc(sz);

	getpassword("Enter your password: ", &buffer, &sz, '\0');
	printf("Your password was %s. Press ENTER to continue.\n", buffer);

	getpassword("Now enter your password and see asterisks appear: ", &buffer, &sz, '*');
	printf("Your password was %s.\n", buffer);

	getchar();

	free(buffer);
	return 0;
}


Create a new paste based on this one


Comments: