aboutsummaryrefslogtreecommitdiff
path: root/slides/2018-software-security/demo/simple.c
blob: cd07c07ece4e992aba7c93e9209d3c6cde6ab13a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>

void fun() {
	printf("fun times!\n");
}

void mul(int first) {
	int second = 0;
	char buf[8] = {1,2,3,4,5,6,7,8};
	printf("Enter a number: ");
	gets(buf);
	second = atoi(buf);
	printf("%d*%d = %d\n", first, second, first*second);
}

int main() {
	int first = 2;
	mul(first);
	return 0;
}