From 3039e545aa96928937b0b380c24bfa8937f47d3f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 15 Jun 2002 22:15:03 +0000 Subject: [PATCH] * stuff --- webcit/locate_host.c | 1 - webcit/messages.c | 4 ++-- webcit/snprintf.c | 2 +- webcit/subst.c | 4 ++-- webcit/tcp_sockets.c | 2 +- webcit/vcard.c | 4 ++-- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/webcit/locate_host.c b/webcit/locate_host.c index fce39363a..4bec272f6 100644 --- a/webcit/locate_host.c +++ b/webcit/locate_host.c @@ -51,5 +51,4 @@ void locate_host(char *tbuf, int client_socket) return; } safestrncpy(tbuf, ch->h_name, 64); - tbuf[63] = 0; } diff --git a/webcit/messages.c b/webcit/messages.c index d70184a2e..6f1dfacbf 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -69,10 +69,10 @@ char buf[]; end = pos; } - safestrncpy(urlbuf, &buf[start], end - start); + strncpy(urlbuf, &buf[start], end - start); urlbuf[end - start] = 0; - safestrncpy(outbuf, buf, start); + strncpy(outbuf, buf, start); sprintf(&outbuf[start], "%cA HREF=%c%s%c TARGET=%c%s%c%c%s%c/A%c", LB, QU, urlbuf, QU, QU, TARGET, QU, RB, urlbuf, LB, RB); strcat(outbuf, &buf[end]); diff --git a/webcit/snprintf.c b/webcit/snprintf.c index 7c8f2b92c..7db792c20 100644 --- a/webcit/snprintf.c +++ b/webcit/snprintf.c @@ -57,7 +57,7 @@ int vsnprintf(char *buf, size_t max, const char *fmt, va_list argp) if ((size = vsprintf(p, fmt, argp)) >= max) size = -1; - safestrncpy(buf, p, max); + strncpy(buf, p, max); buf[max - 1] = 0; free(p); return size; diff --git a/webcit/subst.c b/webcit/subst.c index f5014eb50..095e414a1 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -183,7 +183,7 @@ void do_template(void *templatename) { strcpy(inbuf, ""); } else { - safestrncpy(outbuf, inbuf, pos); + strncpy(outbuf, inbuf, pos); outbuf[pos] = 0; wprintf("%s", outbuf); strcpy(inbuf, &inbuf[pos]); @@ -191,7 +191,7 @@ void do_template(void *templatename) { for (i=strlen(inbuf); i>=0; --i) { if (inbuf[i]=='>') pos = i; } - safestrncpy(key, &inbuf[2], pos-2); + strncpy(key, &inbuf[2], pos-2); key[pos-2] = 0; print_value_of(key); strcpy(inbuf, &inbuf[pos+1]); diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index bb20bbd2f..9c32b7158 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -54,7 +54,7 @@ int uds_connectsock(char *sockpath) memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; - safestrncpy(addr.sun_path, sockpath, sizeof addr.sun_path); + strncpy(addr.sun_path, sockpath, sizeof addr.sun_path); s = socket(AF_UNIX, SOCK_STREAM, 0); if (s < 0) { diff --git a/webcit/vcard.c b/webcit/vcard.c index 6b0421595..f11d253b7 100644 --- a/webcit/vcard.c +++ b/webcit/vcard.c @@ -92,9 +92,9 @@ struct vCard *vcard_load(char *vtext) { if ((nlpos > colonpos) && (colonpos > 0)) { namebuf = malloc(colonpos + 1); valuebuf = malloc(nlpos - colonpos + 1); - safestrncpy(namebuf, ptr, colonpos); + strncpy(namebuf, ptr, colonpos); namebuf[colonpos] = 0; - safestrncpy(valuebuf, &ptr[colonpos+1], nlpos-colonpos-1); + strncpy(valuebuf, &ptr[colonpos+1], nlpos-colonpos-1); valuebuf[nlpos-colonpos-1] = 0; if ( (!strcasecmp(namebuf, "end")) -- 2.39.2