summaryrefslogtreecommitdiff
path: root/ext/dbase
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2007-02-24 18:00:56 +0000
committerIlia Alshanetsky <iliaa@php.net>2007-02-24 18:00:56 +0000
commit9783f5f1f3dd69e06fc5ede7fb6715957bc43955 (patch)
tree66a86692ce4db1eeb97a0b75685305462c55100b /ext/dbase
parent9651aeaf7862f6c1e161dcf23b4d506c103255bb (diff)
downloadphp-git-9783f5f1f3dd69e06fc5ede7fb6715957bc43955.tar.gz
strncpy() -> strlcpy()
Diffstat (limited to 'ext/dbase')
-rw-r--r--ext/dbase/dbf_head.c2
-rw-r--r--ext/dbase/dbf_rec.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c
index 9c9363dfbb..0f9ad61461 100644
--- a/ext/dbase/dbf_head.c
+++ b/ext/dbase/dbf_head.c
@@ -184,7 +184,7 @@ int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf)
/* build the on disk field info */
scp = dbf->db_fname; dcp = dbfield.dbf_name;
- strncpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN);
+ strlcpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN);
dbfield.dbf_type = dbf->db_type;
switch (dbf->db_type) {
diff --git a/ext/dbase/dbf_rec.c b/ext/dbase/dbf_rec.c
index 6e872d3fb7..86db498666 100644
--- a/ext/dbase/dbf_rec.c
+++ b/ext/dbase/dbf_rec.c
@@ -152,8 +152,7 @@ char *get_field_val(char *rp, dbfield_t *fldp, char *cp)
if ( !cp )
cp = (char *)malloc(flen + 1);
if ( cp ) {
- strncpy(cp, &rp[fldp->db_foffset], flen);
- cp[flen] = 0;
+ strlcpy(cp, &rp[fldp->db_foffset], flen + 1);
}
return cp;
}