From 2da4cd5a0a18fe9b1cd142d2af42da594598be33 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 6 Apr 2020 14:03:53 +0800 Subject: [PATCH] fix walMain.c compile warning. --- src/vnode/wal/src/walMain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vnode/wal/src/walMain.c b/src/vnode/wal/src/walMain.c index 9708b0d9dc..99be05cbe4 100644 --- a/src/vnode/wal/src/walMain.c +++ b/src/vnode/wal/src/walMain.c @@ -125,7 +125,7 @@ int walRenew(twal_h handle) { if (pWal->num > pWal->max) { // remove the oldest wal file - char name[TSDB_FILENAME_LEN]; + char name[TSDB_FILENAME_LEN * 3]; sprintf(name, "%s/%s%d", pWal->path, walPrefix, pWal->id - pWal->max); if (remove(name) <0) { wError("wal:%s, failed to remove(%s)", name, strerror(errno)); @@ -177,7 +177,7 @@ int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, SWalHead *, in uint32_t maxId = 0, minId = -1, index =0; int plen = strlen(walPrefix); - char opath[TSDB_FILENAME_LEN]; + char opath[TSDB_FILENAME_LEN+5]; sprintf(opath, "%s/old", pWal->path); // is there old directory? @@ -294,8 +294,8 @@ static int walRestoreWalFile(char *name, void *pVnode, int (*writeFp)(void *, SW int walHandleExistingFiles(char *path) { int code = 0; - char oname[TSDB_FILENAME_LEN]; - char nname[TSDB_FILENAME_LEN]; + char oname[TSDB_FILENAME_LEN * 3]; + char nname[TSDB_FILENAME_LEN * 3]; char opath[TSDB_FILENAME_LEN]; sprintf(opath, "%s/old", path); @@ -336,7 +336,7 @@ int walHandleExistingFiles(char *path) { static int walRemoveWalFiles(char *path) { int plen = strlen(walPrefix); - char name[TSDB_FILENAME_LEN]; + char name[TSDB_FILENAME_LEN * 3]; int code = 0; if (access(path, F_OK) != 0) return 0; -- GitLab