diff options
Diffstat (limited to 'ext/dbase/dbf_head.c')
| -rw-r--r-- | ext/dbase/dbf_head.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c index 42935c2ea..0f9ad6146 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) { @@ -215,7 +215,7 @@ void put_dbf_info(dbhead_t *dbh) int fcnt; if ((cp = db_cur_date(NULL))) { - strncpy(dbh->db_date, cp, 8); + strlcpy(dbh->db_date, cp, 8); free(cp); } put_dbf_head(dbh); @@ -232,16 +232,16 @@ char *get_dbf_f_fmt(dbfield_t *dbf) /* build the field format for printf */ switch (dbf->db_type) { case 'C': - sprintf(format, "%%-%ds", dbf->db_flen); + snprintf(format, sizeof(format), "%%-%ds", dbf->db_flen); break; case 'N': case 'L': case 'D': case 'F': - sprintf(format, "%%%ds", dbf->db_flen); + snprintf(format, sizeof(format), "%%%ds", dbf->db_flen); break; case 'M': - strcpy(format, "%s"); + strlcpy(format, "%s", sizeof(format)); break; default: return NULL; |
