From 71f73d1673c20579b83463456cef3fa3d210c99b Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 14 Jul 2004 12:41:36 +0000 Subject: [PATCH] - Grr! unterminated buffer string in exclude destination buffer - fix isfoo() ctype macros to take unsigned char. --- bin/pax/tar.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/pax/tar.c b/bin/pax/tar.c index b2b733899d95..09c1e37dc51c 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -1,4 +1,4 @@ -/* $NetBSD: tar.c,v 1.56 2004/06/16 14:26:24 christos Exp $ */ +/* $NetBSD: tar.c,v 1.57 2004/07/14 12:41:36 christos Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: tar.c,v 1.56 2004/06/16 14:26:24 christos Exp $"); +__RCSID("$NetBSD: tar.c,v 1.57 2004/07/14 12:41:36 christos Exp $"); #endif #endif /* not lint */ @@ -1302,10 +1302,12 @@ tar_gnutar_exclude_one(const char *line, size_t len) else if (line[i] == '?') { sbuf[j++] = '.'; continue; - } else if (!isalnum(line[i]) && !isblank(line[i])) + } else if (!isalnum((unsigned char)line[i]) && + !isblank((unsigned char)line[i])) sbuf[j++] = '\\'; sbuf[j++] = line[i]; } + sbuf[j] = '\0'; /* don't need the .*\/ ones if we start with /, i guess */ if (line[0] != '/') { (void)snprintf(rabuf, sizeof rabuf, "/.*\\/%s$//", sbuf);