summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/myndbm.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2004-04-15 01:01:56 +0000
committerpeter <peter@FreeBSD.org>2004-04-15 01:01:56 +0000
commit6045cae71a438a752980a395f03717a13cc22179 (patch)
treefd220ac1ddaebaa4a730f86d6f727fb639279056 /contrib/cvs/src/myndbm.c
parent0de1aa939e0bb1831fe5ba20e2afa2fe6d7426ab (diff)
downloadFreeBSD-src-6045cae71a438a752980a395f03717a13cc22179.zip
FreeBSD-src-6045cae71a438a752980a395f03717a13cc22179.tar.gz
Import cvs-1.11.15
Diffstat (limited to 'contrib/cvs/src/myndbm.c')
-rw-r--r--contrib/cvs/src/myndbm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/cvs/src/myndbm.c b/contrib/cvs/src/myndbm.c
index aa71ca8..a5afcce 100644
--- a/contrib/cvs/src/myndbm.c
+++ b/contrib/cvs/src/myndbm.c
@@ -19,7 +19,7 @@
#ifdef MY_NDBM
# ifndef O_ACCMODE
-# define O_ACCMODE O_RDONLY|O_WRONLY|O_RDWR
+# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
# endif /* defined O_ACCMODE */
static void mydbm_load_file PROTO ((FILE *, List *, char *));
@@ -181,12 +181,12 @@ mydbm_store (db, key, value, flags)
node->type = NDBMNODE;
node->key = xmalloc (key.dsize + 1);
- strncpy (node->key, key.dptr, key.dsize);
- node->key[key.dsize] = '\0';
+ *node->key = '\0';
+ strncat (node->key, key.dptr, key.dsize);
node->data = xmalloc (value.dsize + 1);
- strncpy (node->data, value.dptr, value.dsize);
- node->data[value.dsize] = '\0';
+ *(char *)node->data = '\0';
+ strncat (node->data, value.dptr, value.dsize);
db->modified = 1;
if (addnode (db->dbm_list, node) == -1)
OpenPOWER on IntegriCloud