diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-04-27 09:33:21 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-04-27 09:33:21 +0000 |
commit | 36d568b672a161ef3bef63a72a3c040cfac56173 (patch) | |
tree | daa860c14adc4ab47f65a054fc0f3f8377d1dd07 /gnu | |
parent | 1fdc8903a6201a13ada80f097801cd936dea13df (diff) |
strcpy->strlcpy, needed by libstdc++ actually.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/lib/libiberty/src/dyn-string.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gnu/lib/libiberty/src/dyn-string.c b/gnu/lib/libiberty/src/dyn-string.c index 1da76c2110d..be182e2c630 100644 --- a/gnu/lib/libiberty/src/dyn-string.c +++ b/gnu/lib/libiberty/src/dyn-string.c @@ -209,7 +209,7 @@ dyn_string_copy (dest, src) if (dyn_string_resize (dest, src->length) == NULL) return 0; /* Copy DEST into SRC. */ - strcpy (dest->s, src->s); + strlcpy (dest->s, src->s, dest->allocated); /* Update the size of DEST. */ dest->length = src->length; return 1; @@ -229,7 +229,7 @@ dyn_string_copy_cstr (dest, src) if (dyn_string_resize (dest, length) == NULL) return 0; /* Copy DEST into SRC. */ - strcpy (dest->s, src); + strlcpy (dest->s, src, dest->allocated); /* Update the size of DEST. */ dest->length = length; return 1; @@ -349,7 +349,7 @@ dyn_string_append (dest, s) { if (dyn_string_resize (dest, dest->length + s->length) == 0) return 0; - strcpy (dest->s + dest->length, s->s); + strlcpy (dest->s + dest->length, s->s, dest->allocated - dest->length); dest->length += s->length; return 1; } @@ -369,7 +369,7 @@ dyn_string_append_cstr (dest, s) one for the null at the end. */ if (dyn_string_resize (dest, dest->length + len) == NULL) return 0; - strcpy (dest->s + dest->length, s); + strlcpy (dest->s + dest->length, s, dest->allocated - dest->length); dest->length += len; return 1; } |