diff options
author | 2004-02-27 19:58:08 +0000 | |
---|---|---|
committer | 2004-02-27 19:58:08 +0000 | |
commit | 4c87ec0fffaebc2ce23148453dd1d0ccb9822778 (patch) | |
tree | 579dfa430cfd1ba157e9b1a0d4b9e8a5281d0c41 /regress/lib/libpthread/stdio/stdio.c | |
parent | fix CFLAGS -I (diff) | |
download | wireguard-openbsd-4c87ec0fffaebc2ce23148453dd1d0ccb9822778.tar.xz wireguard-openbsd-4c87ec0fffaebc2ce23148453dd1d0ccb9822778.zip |
NO SPRINTF!
Diffstat (limited to 'regress/lib/libpthread/stdio/stdio.c')
-rw-r--r-- | regress/lib/libpthread/stdio/stdio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/regress/lib/libpthread/stdio/stdio.c b/regress/lib/libpthread/stdio/stdio.c index b2dd7c96ef3..1339ca24f46 100644 --- a/regress/lib/libpthread/stdio/stdio.c +++ b/regress/lib/libpthread/stdio/stdio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.c,v 1.2 2003/07/31 21:48:06 deraadt Exp $ */ +/* $OpenBSD: stdio.c,v 1.3 2004/02/27 19:58:08 deraadt Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -100,8 +100,10 @@ int main(int argc, char *argv[]) { - CHECKn(fullname = malloc (strlen (dir_name) + strlen (base_name) + 2)); - sprintf (fullname, "%s/%s", dir_name, base_name); + int len = strlen (dir_name) + strlen (base_name) + 2; + + CHECKn(fullname = malloc (len)); + snprintf(fullname, len, "%s/%s", dir_name, base_name); test_1(); test_2(); |