Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/gen Use actual buffer size instead of sizeof(...
details: https://anonhg.NetBSD.org/src/rev/57c03ef4cd3a
branches: trunk
changeset: 758010:57c03ef4cd3a
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Oct 13 11:19:28 2010 +0000
description:
Use actual buffer size instead of sizeof(char *). Makes the test
work on non-64bit platforms.
diffstat:
tests/lib/libc/gen/t_glob_star.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 29b9b4cc6dcc -r 57c03ef4cd3a tests/lib/libc/gen/t_glob_star.c
--- a/tests/lib/libc/gen/t_glob_star.c Wed Oct 13 11:01:04 2010 +0000
+++ b/tests/lib/libc/gen/t_glob_star.c Wed Oct 13 11:19:28 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_glob_star.c,v 1.4 2010/10/13 10:31:00 pooka Exp $ */
+/* $NetBSD: t_glob_star.c,v 1.5 2010/10/13 11:19:28 pooka Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_glob_star.c,v 1.4 2010/10/13 10:31:00 pooka Exp $");
+__RCSID("$NetBSD: t_glob_star.c,v 1.5 2010/10/13 11:19:28 pooka Exp $");
#include <atf-c.h>
@@ -99,7 +99,7 @@
static void
trim(char *buf, size_t len, const char *name)
{
- char *path = buf, *epath = buf + sizeof(buf) - 1;
+ char *path = buf, *epath = buf + len;
while (path < epath && (*path++ = *name++) != '\0')
continue;
path--;
Home |
Main Index |
Thread Index |
Old Index