From 936f8998cf55bf07a981b929173566e4612877fe Mon Sep 17 00:00:00 2001 From: pooka Date: Wed, 13 Oct 2010 11:19:28 +0000 Subject: [PATCH] Use actual buffer size instead of sizeof(char *). Makes the test work on non-64bit platforms. --- tests/lib/libc/gen/t_glob_star.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/lib/libc/gen/t_glob_star.c b/tests/lib/libc/gen/t_glob_star.c index 2b3b30229449..f66041eea019 100644 --- a/tests/lib/libc/gen/t_glob_star.c +++ b/tests/lib/libc/gen/t_glob_star.c @@ -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 -__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 @@ -99,7 +99,7 @@ static const char *glob_star_not[] = { 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--;