mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
fix database
This commit is contained in:
parent
609c367471
commit
f83f783549
@ -47,7 +47,7 @@ void db::init_header(db_header_t *db, int ver, int len, enum pki_type type,
|
||||
db->version = htons(ver);
|
||||
db->flags = 0;
|
||||
strncpy(db->name, name, NAMELEN);
|
||||
db->name[NAMELEN] = '\0';
|
||||
db->name[NAMELEN-1] = '\0';
|
||||
}
|
||||
|
||||
void db::convert_header(db_header_t *h)
|
||||
@ -166,7 +166,7 @@ int db::rename(enum pki_type type, const char *name, const char *n)
|
||||
}
|
||||
printf("Off = %lu\n", head_offset);
|
||||
strncpy(head.name, n, NAMELEN);
|
||||
head.name[NAMELEN] = '\0';
|
||||
head.name[NAMELEN-1] = '\0';
|
||||
lseek(fd, head_offset, SEEK_SET);
|
||||
ret = write(fd, &head, sizeof(head));
|
||||
if (ret != sizeof(head)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user