From ebb727f186def11139e7fb38fc35d5a67c06d7f5 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Tue, 27 Dec 2016 20:59:38 +1000 Subject: [PATCH] * chg imdb_t->path from pointer to buffer --- src/database.c | 2 +- src/database.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database.c b/src/database.c index ffcf9c9..addf45c 100644 --- a/src/database.c +++ b/src/database.c @@ -85,7 +85,7 @@ int imdb_open(imdb_db_t *db, const char *path, int write) return -1; } db->write = write; - db->path = path; + strncpy(db->path, path, sizeof(db->path)); DB_READ(db, buf, IMDB_REC_LEN, 0); diff --git a/src/database.h b/src/database.h index 136e35f..337fca1 100644 --- a/src/database.h +++ b/src/database.h @@ -7,7 +7,7 @@ typedef struct { int fd; int write; - const char *path; + char path[PATH_MAX]; const char *errstr; unsigned char caps[8]; } imdb_db_t;