Skip to content

Commit 6a93cdf

Browse files
committed
fix: rm unused warning
1 parent 3778046 commit 6a93cdf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

base/hlog.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,9 @@ static void logfile_truncate(logger_t* logger) {
242242
long filesize = ftell(logger->fp_);
243243
long truncate_size = (long)((double)filesize * logger->truncate_percent);
244244
fseek(logger->fp_, -(filesize - truncate_size), SEEK_CUR);
245-
long cur_pos = ftell(logger->fp_);
246245
char buf[4096] = {0};
247246
const char* pbuf = buf;
248-
size_t nread = 0, nwrite = 0;
247+
size_t nread = 0;
249248
char find_newline = 0;
250249
while ((nread = fread(buf, 1, sizeof(buf), logger->fp_)) > 0) {
251250
pbuf = buf;
@@ -262,7 +261,7 @@ static void logfile_truncate(logger_t* logger) {
262261
}
263262
}
264263
if (nread > 0) {
265-
nwrite += fwrite(pbuf, 1, nread, tmpfile);
264+
fwrite(pbuf, 1, nread, tmpfile);
266265
}
267266
}
268267
fclose(tmpfile);

0 commit comments

Comments
 (0)