From: millert Date: Wed, 18 Dec 1996 16:50:07 +0000 (+0000) Subject: Back out strcpy() -> strncpy() change. Not needed as the array is malloc'd X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=37783300a95e7099b8afdab27712dbb04c71e457;p=openbsd Back out strcpy() -> strncpy() change. Not needed as the array is malloc'd with enough space. Guess that's why I didn't commit this before ;-) --- diff --git a/gnu/usr.bin/ld/ldconfig/ldconfig.c b/gnu/usr.bin/ld/ldconfig/ldconfig.c index 84e4fd57f61..6914a845dbb 100644 --- a/gnu/usr.bin/ld/ldconfig/ldconfig.c +++ b/gnu/usr.bin/ld/ldconfig/ldconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldconfig.c,v 1.5 1996/12/18 04:55:53 millert Exp $ */ +/* $OpenBSD: ldconfig.c,v 1.6 1996/12/18 16:50:07 millert Exp $ */ /* * Copyright (c) 1993,1995 Paul Kranenburg @@ -344,13 +344,11 @@ buildhints() /* Insert strings in string table */ bp->hi_namex = str_index; - strncpy(strtab + str_index, shp->name, strtab_sz - str_index - 1); - strtab[strtab_sz-1] = '\0'; + strcpy(strtab + str_index, shp->name); str_index += 1 + strlen(shp->name); bp->hi_pathx = str_index; - strncpy(strtab + str_index, shp->path, strtab_sz - str_index - 1); - strtab[strtab_sz-1] = '\0'; + strcpy(strtab + str_index, shp->path); str_index += 1 + strlen(shp->path); /* Copy versions */ @@ -359,8 +357,7 @@ buildhints() } /* Copy search directories */ - strncpy(strtab + str_index, dir_list, strtab_sz - str_index - 1); - strtab[strtab_sz-1] = '\0'; + strcpy(strtab + str_index, dir_list); str_index += 1 + strlen(dir_list); /* Sanity check */