diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-02-12 06:49:05 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-02-12 06:49:05 +0000 |
commit | 072aa31968bf2b5e98ffb949a44a55f4a9919b2a (patch) | |
tree | cdb439ec18f65971590df383e53bb73055642094 /regress/lib/libc/alloca | |
parent | 57e10100cd9f0e1583d6ee2a24806c79928675a4 (diff) |
simple alloca test. done twice per deraadt@ suggest
Diffstat (limited to 'regress/lib/libc/alloca')
-rw-r--r-- | regress/lib/libc/alloca/Makefile | 5 | ||||
-rw-r--r-- | regress/lib/libc/alloca/alloca.c | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/regress/lib/libc/alloca/Makefile b/regress/lib/libc/alloca/Makefile new file mode 100644 index 00000000000..f31417cda79 --- /dev/null +++ b/regress/lib/libc/alloca/Makefile @@ -0,0 +1,5 @@ +# $OpenBSD: Makefile,v 1.1 2003/02/12 06:49:04 mickey Exp $ + +PROG= alloca + +.include <bsd.regress.mk> diff --git a/regress/lib/libc/alloca/alloca.c b/regress/lib/libc/alloca/alloca.c new file mode 100644 index 00000000000..4f1f18396a1 --- /dev/null +++ b/regress/lib/libc/alloca/alloca.c @@ -0,0 +1,19 @@ +/* $OpeBSD$ */ + +/* Copyright (c) 2003 Michael Shalayeff. Public Domain. */ + +#include <stdio.h> + +int +main() +{ + char *q, *p; + + p = alloca(41); + strcpy(p, "hellow world"); + + q = alloca(53); + strcpy(q, "hellow world"); + + exit(strcmp(p, q)); +} |