diff options
Diffstat (limited to 'src/update.c')
-rw-r--r-- | src/update.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/update.c b/src/update.c index 06986f9..6fc2d06 100644 --- a/src/update.c +++ b/src/update.c @@ -18,6 +18,10 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***/ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <dirent.h> #include <sys/stat.h> #include <string.h> @@ -104,7 +108,8 @@ static int handle_file(struct syrep_db_context *c, uint32_t version, const char struct syrep_nrecno nrecno; memset(&name, 0, sizeof(name)); - strncpy(name.path, path, PATH_MAX); + strncpy(name.path, path, PATH_MAX-1); + name.path[PATH_MAX-1] = 0; if ((r = get_nrecno_by_name(c, &name, &nrecno, 0)) < 0) return -1; |